DigitMagazine

PassAuth

Mar 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1.  
  2. $('#searchFrnd').click(function () {
  3. let emailSearch = $('#chatFrnd').val();
  4. if (!(emailSearch)) {
  5. dialog.showErrorBox('Enter Email Id To Search..');
  6. } else {
  7. $.ajax({
  8. url: server_addr + '/user/chatFriend',
  9. type: 'post',
  10. data: {
  11. friendEmail: emailSearch
  12. },
  13. headers: {
  14. "x-access-token": authToken
  15. },
  16. success: (data) => {
  17. openChatBox(data.friendId, data.friendName);
  18. },
  19. error: (err) => {
  20. let msg = JSON.parse(err.responseText)['message'];
  21. dialog.showErrorBox("Sorry! Can't Chat! ", msg);
  22. }
  23. });
  24. }
  25. });
Add Comment
Please, Sign In to add comment