implement cancelNotification

This commit is contained in:
2025-02-04 11:42:02 -08:00
parent 4c4bd0fc4a
commit d3c824be68

View File

@@ -29,11 +29,19 @@ export const MutationResolvers: Resolvers<ServerContext> = {
return response;
},
cancelNotification: async (_parent, args, context, _info) => {
const response: NotificationResponse = {
message: "Not implemented",
success: false
if (context.notificationService.isNotificationScheduled(args.input)) {
await context.notificationService.cancelNotificationIfExists(args.input);
return {
success: true,
message: "Notification cancelled",
data: args.input,
}
}
return {
success: false,
message: "Notification doesn't exist"
}
return response;
},
},
}