mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add handling for error and successful return
This commit is contained in:
@@ -111,10 +111,12 @@ export class NotificationService {
|
||||
});
|
||||
const json = await response.json();
|
||||
|
||||
// Check whether it was successful
|
||||
// Return the result
|
||||
if (response.status !== 200) {
|
||||
console.error(`Notification failed for device ${deviceId}:`, json.reason);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private getAPNsFullUrlToUse(deviceId: string) {
|
||||
// Construct the fetch request
|
||||
|
||||
Reference in New Issue
Block a user