backend/api/models/availibilityModel.js

26 lines
411 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',
'possible_date',
'preference',
'start_time',
'end_time',
'timezone',
]);
}
function deleteAvailibility(id) {
2020-05-05 14:18:36 +00:00
return db('availibility').where({ id }).del();
}