Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "contacts":
- [
- {
- "contactId": "00001",
- "firstName": "test",
- "lastName": "test",
- "email": "test@test.com",
- "phone": "0207 0000000",
- "role": "Surveyor",
- "customer": "00001",
- "projects": [{"projId": "00002"}]
- },
- {
- "contactId": "00002",
- "firstName": "test1",
- "lastName": "test1",
- "email": "test@test.com",
- "phone": "0207 1111111",
- "role": "Manager",
- "customer": "00001",
- "projects": [{"projId": "00002"}, {"projId": "00003"}]
- }
- ]
- }
- //Get contacts by Project
- app.get('/v1/projcontacts/:id', function(req, res) {
- var id = req.params.id;
- var projContacts = lodash.filter(contactData.contacts, { 'projId': id });
- res.json(projContacts);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement