This file contains the readily available functions which interact with the ITSLanguage categories API.
Categorize Speech Challenges or categories.
Members
(inner, constant) url :string
- Source:
The URL for the category handler(s).
Type:
- string
Methods
(static) create(category) → {Promise}
- Source:
Create a new category.
The most convenient way to pas a category to this create function is to make use of the FormData object.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
category |
Object | The category to create. Properties
|
Returns:
- The category creation promise.
- Type
- Promise
(static) getAll(filtersopt) → {Promise}
- Source:
Get a all top level categories. Top level categories are categories without a parent category.
By default all categories are fetched though it is allowed to pass filters as a
URLSearchParams object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
filters |
URLSearchParams |
<optional> |
The filters to apply to the category list. |
Throws:
-
- If the given optional filters are not an instance of
URLSearchParams.
- If the given optional filters are not an instance of
- Type
- Promise.<string>
Returns:
- The promise for the categories.
- Type
- Promise
(static) getAllWithParentId(id) → {Promise}
- Source:
Get all categories that share the same parent.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The category identifier. |
Returns:
- A promise and when fulfilled the requested categories.
- Type
- Promise
(static) getById(id) → {Promise}
- Source:
Get a single category by its ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The ID of the desired category. |
Returns:
- The promise for the category.
- Type
- Promise
(static) update(id, properties) → {Promise}
- Source:
Update one or more properties of an existing category.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
string | The category identified. |
||||||||||||||||||||||||||||||||
properties |
Object | The properties of the category to update. Properties
|
Returns:
- The category update promise.
- Type
- Promise