CategoryController

CategoryController

Controller for categories.

Constructor

new CategoryController()

Source:

Methods

batchUpdate(categories) → {Promise.<any>}

Batch update a list of categories.

Source:
Parameters:
Name Type Description
categories

List of BatchUpdateCategoriesInput

Returns:
Type:
Promise.<any>

List of categories with _id field

create(category) → {Promise.<any>}

Create a new category, return category ID if successful

Source:
Parameters:
Name Type Description
category Object

The category object

Returns:
Type:
Promise.<any>
  • The id of the category that was created

delete(id) → {Promise.<any>}

Delete a category

Source:
Parameters:
Name Type Description
id string

The category id that will be deleted

Returns:
Type:
Promise.<any>

update(id, category) → {Promise.<any>}

Update category

Source:
Parameters:
Name Type Description
id string

The id of the category that will be updated

category Object

The updated category object

Returns:
Type:
Promise.<any>
  • Returns the id of the updated category