mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
implement cancelNotification
This commit is contained in:
@@ -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;
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user