mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 16:22:44 +00:00
Should throw, not return errors, so they land in catch
This commit is contained in:
@@ -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