Implemented api for searching lists that have parameter email as a subscriber
This commit is contained in:
parent
eb8a5878dd
commit
c085faa157
2 changed files with 45 additions and 0 deletions
|
@ -348,6 +348,22 @@ router.get('/subscriptions/:listId', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/subscriptions/email/:email', (req, res) => {
|
||||
lists.getListsWithEmail(req.params.email, (err, lists) => {
|
||||
if (err) {
|
||||
res.status(500);
|
||||
return res.json({
|
||||
error: err.message || err,
|
||||
data: []
|
||||
});
|
||||
}
|
||||
res.status(200);
|
||||
res.json({
|
||||
data: lists
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/field/:listId', (req, res) => {
|
||||
let input = {};
|
||||
Object.keys(req.body).forEach(key => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue