mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
do not show "Notification not found" error messages (#10931)
* start fixing #10391 * do not show snackbars for notifications not found * revert message changes * update tests * add new test * fix property
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { authWithHeaders } from '../../middlewares/auth';
|
||||
import {
|
||||
NotFound,
|
||||
NotificationNotFound,
|
||||
} from '../../libs/errors';
|
||||
import {
|
||||
model as User,
|
||||
@@ -37,7 +37,7 @@ api.readNotification = {
|
||||
});
|
||||
|
||||
if (index === -1) {
|
||||
throw new NotFound(res.t('messageNotificationNotFound'));
|
||||
throw new NotificationNotFound(req.language);
|
||||
}
|
||||
|
||||
user.notifications.splice(index, 1);
|
||||
@@ -81,7 +81,7 @@ api.readNotifications = {
|
||||
});
|
||||
|
||||
if (index === -1) {
|
||||
throw new NotFound(res.t('messageNotificationNotFound'));
|
||||
throw new NotificationNotFound(req.language);
|
||||
}
|
||||
|
||||
user.notifications.splice(index, 1);
|
||||
@@ -129,7 +129,7 @@ api.seeNotification = {
|
||||
});
|
||||
|
||||
if (!notification) {
|
||||
throw new NotFound(res.t('messageNotificationNotFound'));
|
||||
throw new NotificationNotFound(req.language);
|
||||
}
|
||||
|
||||
notification.seen = true;
|
||||
@@ -179,7 +179,7 @@ api.seeNotifications = {
|
||||
});
|
||||
|
||||
if (!notification) {
|
||||
throw new NotFound(res.t('messageNotificationNotFound'));
|
||||
throw new NotificationNotFound(req.language);
|
||||
}
|
||||
|
||||
notification.seen = true;
|
||||
|
||||
Reference in New Issue
Block a user