backend/api/models/availabilityModel.js

26 lines
414 B
JavaScript
Raw Normal View History

const db = require('../../data/db');
module.exports = {
addAvailability,
deleteAvailability,
};
function addAvailability(data) {
return db('availability')
.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 deleteAvailability(id) {
return db('availability').where({ id }).del();
}