2020-05-05 09:54:02 +00:00
|
|
|
const db = require('../../data/db');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
addAvailibility,
|
|
|
|
deleteAvailibility,
|
|
|
|
};
|
|
|
|
|
|
|
|
function addAvailibility(data) {
|
2020-05-05 14:18:36 +00:00
|
|
|
return db('availibility')
|
2020-05-05 09:54:02 +00:00
|
|
|
.insert(data)
|
2020-05-05 14:18:36 +00:00
|
|
|
.returning([
|
|
|
|
'id',
|
|
|
|
'account_id',
|
|
|
|
'meeting_id',
|
|
|
|
'possible_date',
|
|
|
|
'preference',
|
|
|
|
'start_time',
|
|
|
|
'end_time',
|
|
|
|
'timezone',
|
|
|
|
]);
|
2020-05-05 09:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function deleteAvailibility(id) {
|
2020-05-05 14:18:36 +00:00
|
|
|
return db('availibility').where({ id }).del();
|
2020-05-05 09:54:02 +00:00
|
|
|
}
|