Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#searchFrnd').click(function () {
- let emailSearch = $('#chatFrnd').val();
- if (!(emailSearch)) {
- dialog.showErrorBox('Enter Email Id To Search..');
- } else {
- $.ajax({
- url: server_addr + '/user/chatFriend',
- type: 'post',
- data: {
- friendEmail: emailSearch
- },
- headers: {
- "x-access-token": authToken
- },
- success: (data) => {
- openChatBox(data.friendId, data.friendName);
- },
- error: (err) => {
- let msg = JSON.parse(err.responseText)['message'];
- dialog.showErrorBox("Sorry! Can't Chat! ", msg);
- }
- });
- }
- });
Add Comment
Please, Sign In to add comment