Mixin: baseChild

baseChild

This provides methods used by resources that have only one kind of parent. It's not meant to be used directly.

Methods

(static) count(parentId, paramsopt) → {Promise}

Counts the number of records.
Parameters:
Name Type Attributes Description
parentId Number Parent record ID
params Object <optional>
Query parameters
Returns:
Promise that resolves with the result
Type
Promise

(static) create(parentId, params) → {Promise}

Creates a new record.
Parameters:
Name Type Description
parentId Number Parent record ID
params Object Record properties
Returns:
Promise that resolves with the result
Type
Promise

(static) delete(parentId, id, paramsopt) → {Promise}

Deletes a record.
Parameters:
Name Type Attributes Description
parentId Number Parent record ID
id Number Record ID
params Object <optional>
Query parameters
Returns:
Promise that resolves with the result
Type
Promise

(static) get(parentId, id, paramsopt) → {Promise}

Get a single record by its ID.
Parameters:
Name Type Attributes Description
parentId Number Parent record ID
id Number Record ID
params Object <optional>
Query parameters
Returns:
Promise that resolves with the result
Type
Promise

(static) list(parentId, paramsopt) → {Promise}

Get a list of records.
Parameters:
Name Type Attributes Description
parentId Number Parent record ID
params Object <optional>
Query parameters
Returns:
Promise that resolves with the result
Type
Promise

(static) update(parentId, id, params) → {Promise}

Updates a record.
Parameters:
Name Type Description
parentId Number Parent record ID
id Number Record ID
params Object Record properties
Returns:
Promise that resolves with the result
Type
Promise