A service that handles CRUD operations for user's cards
- Source:
Methods
(static) create(userId, card) → {Promise.<Card>}
Create a card
Parameters:
Name | Type | Description |
---|---|---|
userId |
String | the owner of the card |
card |
Object | the card object to create |
- Source:
Returns:
Promise that eventually creates and resolves a card or throws error
- Type
- Promise.<Card>
(static) del(cardId) → {Promise}
Deletes a single card
Parameters:
Name | Type | Description |
---|---|---|
cardId |
String | the ID of the card |
- Source:
Returns:
Promise that eventually deletes a card or throws error
- Type
- Promise
(static) list(params) → {Promise.<Array.<Card>>}
List all cards
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | the parameters to limit the query to desired results |
- Source:
Returns:
Promise that eventually resolves an array of cards or throws error
- Type
- Promise.<Array.<Card>>
(static) read(cardId) → {Promise.<Card>}
Retrieves a single card by ID
Parameters:
Name | Type | Description |
---|---|---|
cardId |
String | the ID of the card |
- Source:
Returns:
Promise that eventually resolves a card or throws error
- Type
- Promise.<Card>
(static) update(cardId, body) → {Promise.<Card>}
Updates a single card
Parameters:
Name | Type | Description |
---|---|---|
cardId |
String | the ID of the card |
body |
Object | key/value pairs of the fields that should be changed |
- Source:
Returns:
Promise that eventually updates and resolves a card or throws error
- Type
- Promise.<Card>