backend/api/models/availabilityModel.js

25 lines
399 B
JavaScript

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