mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 00:32:45 +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 });
|
}, { versionKey: false });
|
||||||
|
|
||||||
NotificationSchema.statics.addNotification = async function(data) {
|
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 = {
|
const defaults = {
|
||||||
title : '',
|
title : '',
|
||||||
|
|||||||
Reference in New Issue
Block a user