backend/api/models/participantModel.js
rui hildt 63843d1afc Remove unused participant knex query
Also fix returned data from getMeetingsByAccountId
2020-08-28 19:30:36 +02:00

43 lines
640 B
JavaScript

const db = require('../../data/db');
module.exports = {
addParticipant,
updateParticipant,
deleteParticipant,
};
function addParticipant(data) {
return db('participant')
.insert(data)
.returning([
'id',
'email',
'account_id',
'meeting_id',
'quorum',
'mandatory',
'host',
'answered',
]);
}
function updateParticipant(data, id) {
return db('participant')
.where({ id })
.update(data)
.returning([
'id',
'email',
'account_id',
'meeting_id',
'quorum',
'mandatory',
'host',
'answered',
]);
}
function deleteParticipant(id) {
return db('participant').where({ id }).del();
}