0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 12:02:48 +00:00

Change another return to throw

This commit is contained in:
Trevor Buckner
2024-10-09 14:41:37 -04:00
parent 23e3c98a0d
commit 9635e1a8eb

View File

@@ -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();