categories.list(class_id, options);
Retrieve a list of Categories in a Class.
Parameter | Type | Description |
---|
class_id | string | The UUID of the class. |
options | object | This function supports standard paging options. |
for await (const category of edlink.categories.list(class_id)) {
console.log(category.name);
}
categories.create(class_id, category);
Create a Category in a Class.
Parameter | Type | Description |
---|
class_id | string | The UUID of the class. |
category | Category | The category to create. |
const new_category = await edlink.categories.create(class_id, {
name: 'Homework',
position: 1
});
console.log(new_category.id);
categories.fetch(class_id, category_id);
Retrieve a Category in a Class.
Parameter | Type | Description |
---|
class_id | string | The UUID of the class. |
category_id | string | The UUID of the category. |
const category = await edlink.categories.fetch(class_id, category_id);
console.log(category.name);
categories.update(class_id, category_id, patch);
Update a Category in a Class.
Parameter | Type | Description |
---|
class_id | string | The UUID of the class. |
category_id | string | The UUID of the category. |
patch | Category | A partial category object to patch the category with. |
const updated_category = await edlink.categories.update(class_id, category_id, {
name: 'Updated Category Name',
position: 2
});
console.log(updated_category.name);
categories.delete(class_id, category_id);
Delete a Category in a Class.
Parameter | Type | Description |
---|
class_id | string | The UUID of the class. |
category_id | string | The UUID of the category. |
await edlink.categories.delete(class_id, category_id);
console.log('Category deleted');