Complete account endpoints
This commit is contained in:
@@ -5,7 +5,7 @@ module.exports = {
|
||||
getAccountById,
|
||||
updateAccount,
|
||||
deleteAccount,
|
||||
// getMeetingsByAccountId,
|
||||
getMeetingsByAccountId,
|
||||
};
|
||||
|
||||
function addAccount(data) {
|
||||
@@ -39,20 +39,20 @@ function deleteAccount(id) {
|
||||
return db('account').where({ id }).del();
|
||||
}
|
||||
|
||||
// function getMeetingsByAccountId(id) {
|
||||
// // Get all meetings to which an account is participating
|
||||
// // select id, title, description, start_time, timezone, duration, status where
|
||||
// return db('participant')
|
||||
// .where({ id })
|
||||
// .select(
|
||||
// 'id',
|
||||
// 'username',
|
||||
// 'email',
|
||||
// 'timezone',
|
||||
// 'earliest_time',
|
||||
// 'latest_time',
|
||||
// );
|
||||
// }
|
||||
function getMeetingsByAccountId(account_id) {
|
||||
return db('participant as p')
|
||||
.select(
|
||||
'm.id',
|
||||
'm.title',
|
||||
'm.description',
|
||||
'm.start_time',
|
||||
'm.timezone',
|
||||
'm.duration',
|
||||
'm.status',
|
||||
)
|
||||
.join('meeting as m', { 'm.id': 'p.meeting_id' })
|
||||
.where({ account_id });
|
||||
}
|
||||
|
||||
function getAccountById(id) {
|
||||
return db('account')
|
||||
|
||||
Reference in New Issue
Block a user