Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gianlazz committed Jun 1, 2024
1 parent b5c55da commit a71fcff
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions src/notification/notification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,28 @@ export class NotificationService {
to: string,
) {
this.logger.debug(this.sendPushNotification.name);
// const data = {
// notification,
// to,
// };
const data = {
notification,
to,
};

const result = await this.httpService
.post(this.sendEndpoint, data, {
headers: {
Authorization: 'key=' + this.serverKey,
},
})
.toPromise()
.catch((e) => this.logger.debug(e));

return result;
}

private async sendWebPushNotification(
notification: PushNotificationDto,
to: string,
) {
this.logger.debug(this.sendWebPushNotification.name);
webpush
.sendNotification(
subscription,
Expand All @@ -168,16 +186,5 @@ export class NotificationService {
.catch((error) => {
console.log(error);
});

// const result = await this.httpService
// .post(this.sendEndpoint, data, {
// headers: {
// Authorization: 'key=' + this.serverKey,
// },
// })
// .toPromise()
// .catch((e) => this.logger.debug(e));

// return result;
}
}

0 comments on commit a71fcff

Please sign in to comment.