use fetch syntax from virtuacoplenny

This commit is contained in:
Aaron van Meerten 2019-02-13 16:23:26 -06:00
parent 76638f524d
commit 1a5e2763c1
1 changed files with 13 additions and 16 deletions

View File

@ -274,22 +274,19 @@ export function invitePeopleAndChatRooms( // eslint-disable-line max-params
return Promise.resolve();
}
return new Promise((resolve, reject) => {
$.ajax({
url: `${inviteServiceUrl}?token=${jwt}`,
data: JSON.stringify({
'invited': inviteItems,
'url': inviteUrl
}),
dataType: 'json',
contentType: 'application/json', // send as JSON
success: resolve, // called when success is reached
// called when there is an error
error: (jqxhr, textStatus, error) => {
reject(error);
}
});
});
return fetch(
`${inviteServiceUrl}?token=${jwt}`,
{
body: JSON.stringify({
'invited': inviteItems,
'url': inviteUrl
}),
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}
);
}
/**