mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 01:22:44 +00:00
Change another return to throw
This commit is contained in:
@@ -32,7 +32,7 @@ NotificationSchema.statics.addNotification = async function(data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
NotificationSchema.statics.deleteNotification = async function(dismissKey) {
|
NotificationSchema.statics.deleteNotification = async function(dismissKey) {
|
||||||
if(!dismissKey) return { message: 'No key provided!' };
|
if(!data.dismissKey) throw { message: 'Dismiss key is required!' };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const deletedNotification = await this.findOneAndDelete({ dismissKey }).exec();
|
const deletedNotification = await this.findOneAndDelete({ dismissKey }).exec();
|
||||||
|
|||||||
Reference in New Issue
Block a user