Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
added extra endpoints for more advanced filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Sectimus committed Dec 15, 2019
1 parent 0f75730 commit d64946d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,20 @@ router.get("/sessions", function(req, res) {
res.send(sessions);
});

//get session by id
router.get("/sessions/:id", function(req, res) {
var id = req.params["id"];
var session = sessions.find(x => x.id == id);
res.status(200);
res.send(session);
});

//get talks by sessionid
router.get("/talks/session/:id", function(req, res) {
var id = req.params["id"];
var talksArray = talks.filter(x => x.session == id);
res.status(200);
res.send(talksArray);
});

module.exports = router;

0 comments on commit d64946d

Please sign in to comment.