0
0
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:
Trevor Buckner
2024-10-09 14:40:11 -04:00
parent e873dcf3a8
commit 346bb0086e

View File

@@ -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 : '',