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