Add availibility endpoints

This commit is contained in:
rui hildt 2020-05-05 16:18:36 +02:00
parent 57b66883da
commit fa8dfb8ebc
3 changed files with 14 additions and 5 deletions

View File

@ -6,11 +6,20 @@ module.exports = {
};
function addAvailibility(data) {
return db('possible_date')
return db('availibility')
.insert(data)
.returning(['id', 'meeting_id', 'possible_date']);
.returning([
'id',
'account_id',
'meeting_id',
'possible_date',
'preference',
'start_time',
'end_time',
'timezone',
]);
}
function deleteAvailibility(id) {
return db('possible_date').where({ id }).del();
return db('availibility').where({ id }).del();
}

View File

@ -17,7 +17,7 @@ router.post('/', async (req, res) => {
}
});
router.delete('/:possible_date_id', async (req, res) => {
router.delete('/:id', async (req, res) => {
const id = req.params.id;
try {

View File

@ -17,7 +17,7 @@ router.post('/', async (req, res) => {
}
});
router.delete('/:possible_date_id', async (req, res) => {
router.delete('/:id', async (req, res) => {
const id = req.params.id;
try {