mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
fix method calls and tests
This commit is contained in:
@@ -30,7 +30,7 @@ export const MutationResolvers: Resolvers<ServerContext> = {
|
||||
: ETANotificationScheduler.defaultSecondsThresholdForNotificationToFire,
|
||||
}
|
||||
|
||||
await context.notificationRepository.scheduleNotification(notificationData);
|
||||
await context.notificationRepository.addOrUpdateNotification(notificationData);
|
||||
|
||||
const response: NotificationResponse = {
|
||||
message: "Notification scheduled",
|
||||
@@ -40,8 +40,9 @@ export const MutationResolvers: Resolvers<ServerContext> = {
|
||||
return response;
|
||||
},
|
||||
cancelNotification: async (_parent, args, context, _info) => {
|
||||
if (context.notificationRepository.isNotificationScheduled(args.input)) {
|
||||
await context.notificationRepository.cancelNotificationIfExists(args.input);
|
||||
const isScheduled = await context.notificationRepository.isNotificationScheduled(args.input)
|
||||
if (isScheduled) {
|
||||
await context.notificationRepository.deleteNotificationIfExists(args.input);
|
||||
return {
|
||||
success: true,
|
||||
message: "Notification cancelled",
|
||||
|
||||
Reference in New Issue
Block a user