getUserCategories()
getUserCategories(
userId:string):Promise<Category[]>
Defined in: packages/core/src/index.ts:1019
Get categories assigned to a specific user
Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | The unique identifier of the user |
Returns
Promise<Category[]>
Array of category objects assigned to the user
Throws
401 - Not authenticated
Throws
404 - User not found
Example
import { getUserCategories } from "@cpod/sdk";
const userCategories = await getUserCategories("user-123");
console.log(`User belongs to ${userCategories.length} categories`);
userCategories.forEach(cat => console.log(cat.name));