mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
implement method in NotificationService
This commit is contained in:
@@ -256,6 +256,22 @@ export class NotificationService {
|
|||||||
* @param deviceId
|
* @param deviceId
|
||||||
*/
|
*/
|
||||||
public async getAllScheduledNotificationsForDevice(deviceId: string): Promise<ScheduledNotificationData[]> {
|
public async getAllScheduledNotificationsForDevice(deviceId: string): Promise<ScheduledNotificationData[]> {
|
||||||
return [];
|
const scheduledNotifications: ScheduledNotificationData[] = [];
|
||||||
|
|
||||||
|
for (const key of Object.keys(this.deviceIdsToDeliverTo)) {
|
||||||
|
if (this.deviceIdsToDeliverTo[key].has(deviceId)) {
|
||||||
|
const tupleKey = TupleKey.fromExistingStringKey(key);
|
||||||
|
const shuttleId = tupleKey.tuple[0]
|
||||||
|
const stopId = tupleKey.tuple[1];
|
||||||
|
|
||||||
|
scheduledNotifications.push({
|
||||||
|
shuttleId,
|
||||||
|
stopId,
|
||||||
|
deviceId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return scheduledNotifications;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user