Complete meeting endpoints
This commit is contained in:
@@ -40,7 +40,7 @@ router.delete('/:id', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
router.get('/:id', async (req, res) => {
|
||||
const id = req.params.id;
|
||||
|
||||
try {
|
||||
@@ -51,4 +51,38 @@ router.get('/', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
router.get('/:id/participants', async (req, res) => {
|
||||
const id = req.params.id;
|
||||
|
||||
try {
|
||||
const meeting = await Meeting.getParticipantsByMeetingId(id);
|
||||
res.status(200).json(meeting);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: "Meeting doesn't exist.", error });
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/:id/possible-dates', async (req, res) => {
|
||||
const id = req.params.id;
|
||||
|
||||
try {
|
||||
const meeting = await Meeting.getPossibleDatesByMeetingId(id);
|
||||
res.status(200).json(meeting);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: "Meeting doesn't exist.", error });
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/:id/availibility', async (req, res) => {
|
||||
const id = req.params.id;
|
||||
|
||||
try {
|
||||
const meeting = await Meeting.getAvailibilityByMeetingId(id);
|
||||
res.status(200).json(meeting);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: "Meeting doesn't exist.", error });
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user