backend/api/models/availibilityModel.js

26 lines
414 B
JavaScript

const db = require('../../data/db');
module.exports = {
addAvailibility,
deleteAvailibility,
};
function addAvailibility(data) {
return db('availibility')
.insert(data)
.returning([
'id',
'account_id',
'meeting_id',
'possible_date_id',
'preference',
'start_time',
'end_time',
'timezone',
]);
}
function deleteAvailibility(id) {
return db('availibility').where({ id }).del();
}