We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0a986c commit 657388aCopy full SHA for 657388a
services/api/src/core/notifications/client/gateways/notification.web-push.gateway.ts
@@ -18,14 +18,22 @@ export class NotificationWebPushGateway {
18
);
19
}
20
21
- public async sendWebPush(profileId: number, notification: INotification) {
+ public async sendWebPush(
22
+ profileId: number,
23
+ notification: INotification,
24
+ ): Promise<boolean> {
25
const pushSubscription =
26
this.notificationSubscriptionService.getSubscription(profileId);
27
28
if (!pushSubscription) {
- return;
29
+ return false;
30
31
- await sendNotification(pushSubscription, JSON.stringify(notification));
32
+ const result = await sendNotification(
33
+ pushSubscription,
34
+ JSON.stringify(notification),
35
+ );
36
+
37
+ return result.statusCode < 400;
38
39
0 commit comments