24 lines
386 B
JavaScript
24 lines
386 B
JavaScript
const db = require('../../data/db');
|
|
|
|
module.exports = {
|
|
addAvailability,
|
|
deleteAvailability,
|
|
};
|
|
|
|
function addAvailability(data) {
|
|
return db('availability')
|
|
.insert(data)
|
|
.returning([
|
|
'id',
|
|
'participant_id',
|
|
'possible_date_id',
|
|
'preference',
|
|
'start_time',
|
|
'end_time',
|
|
]);
|
|
}
|
|
|
|
function deleteAvailability(id) {
|
|
return db('availability').where({ id }).del();
|
|
}
|