Skip to content

Commit

Permalink
Merge branch 'develop' into chore/ListItem-stories
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored May 18, 2023
2 parents 9b2fdcf + eee580d commit c9dd8cf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apps/meteor/app/push/server/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,16 @@ class PushClass {
async sendGatewayPush(gateway, service, token, notification, tries = 0) {
notification.uniqueId = this.options.uniqueId;

const data = {
const options = {
method: 'POST',
body: {
token,
options: notification,
},
...(token && this.options.getAuthorization && { headers: { Authorization: await this.options.getAuthorization() } }),
};

if (token && this.options.getAuthorization) {
data.headers.Authorization = await this.options.getAuthorization();
}

const result = await fetch(`${gateway}/push/${service}/send`, { ...data, method: 'POST' });
const result = await fetch(`${gateway}/push/${service}/send`, options);
const response = await result.text();

if (result.status === 406) {
Expand Down

0 comments on commit c9dd8cf

Please sign in to comment.