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();
|
const json = await response.json();
|
||||||
|
|
||||||
// Check whether it was successful
|
if (response.status !== 200) {
|
||||||
// Return the result
|
console.error(`Notification failed for device ${deviceId}:`, json.reason);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private getAPNsFullUrlToUse(deviceId: string) {
|
private getAPNsFullUrlToUse(deviceId: string) {
|
||||||
// Construct the fetch request
|
// Construct the fetch request
|
||||||
|
|||||||
Reference in New Issue
Block a user