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;
|
return response;
|
||||||
},
|
},
|
||||||
cancelNotification: async (_parent, args, context, _info) => {
|
cancelNotification: async (_parent, args, context, _info) => {
|
||||||
const response: NotificationResponse = {
|
if (context.notificationService.isNotificationScheduled(args.input)) {
|
||||||
message: "Not implemented",
|
await context.notificationService.cancelNotificationIfExists(args.input);
|
||||||
success: false
|
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