backend/api/models/accountModel.js
2020-05-01 18:24:59 +02:00

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,
);
}