Methods
(async) add(command)
Add method that saves notes to the database
Parameters:
Name | Type | Description |
---|---|---|
command |
note | adds the proper note with given category |
- Source:
Returns:
Adding note: "payload of note"
(async) delete(command)
Deletes notes by the ID
Parameters:
Name | Type | Description |
---|---|---|
command |
id | ID of note to be deleted |
- Source:
Returns:
Number of documents deleted
execute(command, command, command)
Switches to proper case method with given params
Parameters:
Name | Type | Description |
---|---|---|
command |
add | runs the add method |
command |
list | runs the list method |
command |
delete | runs the delete method |
- Source:
Returns:
Console Log of action completed
(async) list(command, command)
Method that gets select notes from database
Parameters:
Name | Type | Description |
---|---|---|
command |
category | Notes by Category |
command |
command | All notes |
- Source:
listNotesFilter(array, array)
Callback function that populates given list
Parameters:
Name | Type | Description |
---|---|---|
array |
allNotes | All notes in database |
array |
selectedNotes | All notes in selected Category |
- Source:
Returns:
The correct list