From 9635e1a8eb7fbdda1cf412eb6b8462207b3b3577 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 9 Oct 2024 14:41:37 -0400 Subject: [PATCH] Change another `return` to `throw` --- server/notifications.model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notifications.model.js b/server/notifications.model.js index 10e105985..8eed4c0d6 100644 --- a/server/notifications.model.js +++ b/server/notifications.model.js @@ -32,7 +32,7 @@ NotificationSchema.statics.addNotification = async function(data) { }; NotificationSchema.statics.deleteNotification = async function(dismissKey) { - if(!dismissKey) return { message: 'No key provided!' }; + if(!data.dismissKey) throw { message: 'Dismiss key is required!' }; try { const deletedNotification = await this.findOneAndDelete({ dismissKey }).exec();