API: get list by id
This commit is contained in:
parent
5f18c9d44f
commit
60adfed0a6
2 changed files with 35 additions and 1 deletions
|
@ -364,6 +364,21 @@ router.get('/lists', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/list/:id', (req, res) => {
|
||||
lists.get(req.params.id, (err, list) => {
|
||||
if (err) {
|
||||
res.status(500);
|
||||
return res.json({
|
||||
error: err.message || err,
|
||||
});
|
||||
}
|
||||
res.status(200);
|
||||
res.json({
|
||||
data: list
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/lists/:email', (req, res) => {
|
||||
lists.getListsWithEmail(req.params.email, (err, lists) => {
|
||||
if (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue