invite post to use application/JSON

changed to .ajax from .post to allow content type to be set
This commit is contained in:
Aaron van Meerten 2019-02-12 16:28:33 -06:00
parent 8ea693616d
commit 76638f524d
1 changed files with 14 additions and 9 deletions

View File

@ -275,15 +275,20 @@ export function invitePeopleAndChatRooms( // eslint-disable-line max-params
}
return new Promise((resolve, reject) => {
$.post(
`${inviteServiceUrl}?token=${jwt}`,
JSON.stringify({
'invited': inviteItems,
'url': inviteUrl
}),
resolve,
'json')
.fail((jqxhr, textStatus, error) => reject(error));
$.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);
}
});
});
}