SHARE
TWEET

Untitled

a guest Mar 18th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     "contacts":
  3.     [
  4.         {
  5.             "contactId": "00001",
  6.             "firstName": "test",
  7.             "lastName": "test",
  8.             "email": "test@test.com",
  9.             "phone": "0207 0000000",
  10.             "role": "Surveyor",
  11.             "customer": "00001",
  12.             "projects": [{"projId": "00002"}]
  13.         },
  14.         {
  15.             "contactId": "00002",
  16.             "firstName": "test1",
  17.             "lastName": "test1",
  18.             "email": "test@test.com",
  19.             "phone": "0207 1111111",
  20.             "role": "Manager",
  21.             "customer": "00001",
  22.             "projects": [{"projId": "00002"}, {"projId": "00003"}]
  23.         }
  24.     ]
  25. }
  26.      
  27. //Get contacts by Project
  28. app.get('/v1/projcontacts/:id', function(req, res) {
  29.     var id = req.params.id;
  30.     var projContacts = lodash.filter(contactData.contacts, { 'projId': id });
  31.     res.json(projContacts);
  32. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top