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) => { return new Promise((resolve, reject) => {
$.post( $.ajax({
`${inviteServiceUrl}?token=${jwt}`, url: `${inviteServiceUrl}?token=${jwt}`,
JSON.stringify({ data: JSON.stringify({
'invited': inviteItems, 'invited': inviteItems,
'url': inviteUrl 'url': inviteUrl
}), }),
resolve, dataType: 'json',
'json') contentType: 'application/json', // send as JSON
.fail((jqxhr, textStatus, error) => reject(error)); success: resolve, // called when success is reached
// called when there is an error
error: (jqxhr, textStatus, error) => {
reject(error);
}
});
}); });
} }