Update remaining models to db change

This commit is contained in:
rui hildt 2020-08-28 19:02:50 +02:00
parent f53842271a
commit c69c510604
2 changed files with 32 additions and 30 deletions

View File

@ -20,6 +20,7 @@ function addMeeting(data) {
'start_time', 'start_time',
'duration', 'duration',
'status', 'status',
'password',
]); ]);
} }
@ -34,6 +35,7 @@ function updateMeeting(data, id) {
'start_time', 'start_time',
'duration', 'duration',
'status', 'status',
'password',
]); ]);
} }
@ -52,6 +54,7 @@ function getMeetingById(id) {
'start_time', 'start_time',
'duration', 'duration',
'status', 'status',
'password',
); );
} }
@ -59,8 +62,8 @@ function getParticipantsByMeetingId(meeting_id) {
return db('participant as p') return db('participant as p')
.select( .select(
'p.id', 'p.id',
'p.account_id',
'p.email', 'p.email',
'p.account_id',
'p.meeting_id', 'p.meeting_id',
'p.quorum', 'p.quorum',
'p.mandatory', 'p.mandatory',
@ -82,8 +85,7 @@ function getAvailabilityByMeetingId(meeting_id) {
return db('availability as a') return db('availability as a')
.select( .select(
'a.id', 'a.id',
'a.meeting_id', 'a.participant_id',
'a.account_id',
'a.possible_date_id', 'a.possible_date_id',
'a.preference', 'a.preference',
'a.start_time', 'a.start_time',

View File

@ -2,10 +2,10 @@ const db = require('../../data/db');
module.exports = { module.exports = {
addParticipant, addParticipant,
getParticipantById,
updateParticipant, updateParticipant,
deleteParticipant, deleteParticipant,
// getMeetingsByParticipantId, // getMeetingsByParticipantId,
// getParticipantById,
}; };
function addParticipant(data) { function addParticipant(data) {
@ -14,11 +14,11 @@ function addParticipant(data) {
.returning([ .returning([
'id', 'id',
'email', 'email',
'account_id', 'account_id',
'meeting_id', 'meeting_id',
'quorum', 'quorum',
'mandatory', 'mandatory',
'host', 'host',
'answered', 'answered',
]); ]);
} }
@ -30,31 +30,31 @@ function updateParticipant(data, id) {
.returning([ .returning([
'id', 'id',
'email', 'email',
'account_id', 'account_id',
'meeting_id', 'meeting_id',
'quorum', 'quorum',
'mandatory', 'mandatory',
'host', 'host',
'answered', 'answered',
]); ]);
} }
function deleteParticipant(id) { function deleteParticipant(id) {
return db('participant').where({id }).del(); return db('participant').where({ id }).del();
} }
function getParticipantById(id) { // function getParticipantById(id) {
return db('participant') // return db('participant')
.where({ id }) // .where({ id })
.first() // .first()
.select( // .select(
'id', // 'id',
'email', // 'email',
'account_id', // 'account_id',
'meeting_id', // 'meeting_id',
'quorum', // 'quorum',
'mandatory', // 'mandatory',
'host', // 'host',
'answered', // 'answered',
); // );
} // }