mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-21 21:06:58 +00:00
Change another return to throw
This commit is contained in:
1 parent
23e3c98a0d
commit
9635e1a8eb
1 file changed
+1
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user