Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. let search = (username, surname, email, dob, page = 1, perPage = 20) => {
  2. if(username !== '' && username !== undefined)
  3. body['username'] = username;
  4. if(surname !== '' && surname !== undefined)
  5. body['surname'] = surname;
  6. if(email !== '' && email !== undefined)
  7. body['email'] = email;
  8. if(dob !== '' && dob !== undefined)
  9. body['dob'] = dob;
  10. let options = {
  11. method: "PUT",
  12. body: JSON.stringify(body),
  13. headers: {
  14. "Content-Type": 'application/json'
  15. },
  16. credentials: 'same-origin'
  17. };
  18. return options;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement