backend/api/models/availibilityModel.js

26 lines
414 B
JavaScript
Raw Normal View History

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