-
Notifications
You must be signed in to change notification settings - Fork 50
Database
The database is split up into several modules. To get the full functionality, you should import the entire folder.
const db = require("./server/database");
This is part of the auth module.
All the functions return a user object, defined as such.
{
id, // uuid
name, // string
email, // string
division, // string
password // string
}Returns the user associated with the given id.
Parameters: { id }
Returns: [User Object]: The associated user
Creates a user given all the required parameters. Note that you need to pass in a valid uuid for id.
Parameters: { id, name, email, division, password }
Returns: [User Object]: The user that got created
Updates the parameters of a user with a given id. Only the id parameter is required to be not undefined. If a parameter is undefined, that parameter will not be updated.
Parameters: { id, name, email, division, password }
Returns: [User Object]: The updated user