15 lines
409 B
JavaScript
15 lines
409 B
JavaScript
const db = require('../../data/dbConfig');
|
|
|
|
module.exports = {
|
|
addUser,
|
|
};
|
|
|
|
function addUser(userData) {
|
|
// TODO Complete query without providing id
|
|
// right now if ID is not provided, pg-promise send an erro fo mising column
|
|
return db.one(
|
|
'INSERT INTO account VALUES(emptyUpdate, ${username}, ${email}, ${password}, ${timezone}, ${earliest_time}, ${latest_time}) RETURNING *',
|
|
userData,
|
|
);
|
|
}
|