mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 18:56:54 +00:00
Should throw, not return errors, so they land in catch
This commit is contained in:
1 parent
e873dcf3a8
commit
346bb0086e
1 file changed
+1
-1
@@ -11,7 +11,7 @@ const NotificationSchema = new mongoose.Schema({
|
||||
}, { versionKey: false });
|
||||
|
||||
NotificationSchema.statics.addNotification = async function(data) {
|
||||
if(!data.dismissKey) return { message: 'Dismiss key is required!' };
|
||||
if(!data.dismissKey) throw { message: 'Dismiss key is required!' };
|
||||
|
||||
const defaults = {
|
||||
title : '',
|
||||
|
||||
Reference in new issue
Block a user