Namespace: DescriptionService

DescriptionService

A service that handles CRUD operations for user's descriptions
Source:

Methods

(static) create(userId, description) → {Promise.<Description>}

Create a description
Parameters:
Name Type Description
userId String the owner of the description
description Object the description object to create
Source:
Returns:
Promise that eventually creates and resolves a description or throws error
Type
Promise.<Description>

(static) del(descriptionId) → {Promise}

Deletes a single description
Parameters:
Name Type Description
descriptionId String the ID of the description
Source:
Returns:
Promise that eventually deletes a description or throws error
Type
Promise

(static) findOrCreate(userId, description) → {Promise.<Description>}

Find or Create a description
Parameters:
Name Type Description
userId String the owner of the description
description Object the description object to create
Properties
Name Type Description
description String the description string in the object
Source:
Returns:
eventually creates and returns a description or throws error
Type
Promise.<Description>

(static) list(params) → {Promise.<Array.<Description>>}

List all descriptions
Parameters:
Name Type Description
params Object the parameters to limit the query to desired results
Source:
Returns:
Promise that eventually resolves an array of descriptions or throws error
Type
Promise.<Array.<Description>>

(static) read(descriptionId) → {Promise.<Description>}

Retrieves a single description by ID
Parameters:
Name Type Description
descriptionId String the ID of the description
Source:
Returns:
Promise that eventually resolves a description or throws error
Type
Promise.<Description>

(static) update(descriptionId, body) → {Promise.<Description>}

Updates a single description
Parameters:
Name Type Description
descriptionId String the ID of the description
body Object key/value pairs of the fields that should be changed
Source:
Returns:
Promise that eventually updates and resolves a description or throws error
Type
Promise.<Description>