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