Namespace: RelationshipService

RelationshipService

A service that handles CRUD operations for relationship objects.
Source:

Methods

(static) create(userId, relationship) → {Promise.<Relationship>}

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

(static) del(relationshipId) → {Promise}

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

(static) list() → {Promise.<Relationship>}

List all relationships
Source:
Returns:
eventually resolves an array of relationships or throws error
Type
Promise.<Relationship>

(static) read(relationshipId) → {Promise.<Relationship>}

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

(static) update(relationshipId, body) → {Promise.<Relationship>}

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