backend/api/models/accountModel.js

15 lines
403 B
JavaScript
Raw Normal View History

2020-05-02 19:06:34 +00:00
const db = require('../../data/db');
2020-05-01 15:32:46 +00:00
module.exports = {
2020-05-01 16:24:59 +00:00
addUser,
2020-05-01 15:32:46 +00:00
};
function addUser(userData) {
2020-05-01 16:24:59 +00:00
// 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,
);
}