Module: lists-dal

Methods

(static) create(list) → {Promise.<CustomError>}

Creates a list entry with a user_id associated and a type of list
Parameters:
Name Type Description
list string
Source:
Returns:
Type
Promise.<CustomError>

(static) deactivate(listId) → {*}

Puts the active BIT to 0 of a list with id=listId, deactivates active list, it only deactivates because we don't wanna change inactive list's status for history purposes
Parameters:
Name Type Description
listId int
Source:
Returns:
Type
*

(static) delete(id) → {*}

Deletes a list by its id
Parameters:
Name Type Description
id int
Source:
Returns:
Type
*

(static) get()

asks the database for all list entries
Source:
Returns:

(static) getActive() → {PromiseLike.<function(*=): *>|Promise.<function(*=): *>}

Returns all lists with active BIT to 1, asks the database for all list entries that are active at the moment
Source:
Returns:
Type
PromiseLike.<function(*=): *> | Promise.<function(*=): *>

(static) getById(id) → {Promise.<(Object|Error)>}

Returns the list with the specified id
Parameters:
Name Type Description
id int
Source:
Returns:
Type
Promise.<(Object|Error)>

(static) update(id, list) → {Promise.<{insertedRows: *, id: *, list: *}>}

Changes the list name (field: list) of a list with id=id
Parameters:
Name Type Description
id int
list string
Source:
Returns:
Type
Promise.<{insertedRows: *, id: *, list: *}>