mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
notifications: fixes
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import packageInfo from '../../../package.json';
|
||||
import {
|
||||
model as UserNotification,
|
||||
} from '../models/userNotification';
|
||||
|
||||
module.exports = function responseHandler (req, res, next) {
|
||||
// Only used for successful responses
|
||||
@@ -13,7 +16,7 @@ module.exports = function responseHandler (req, res, next) {
|
||||
if (message) response.message = message;
|
||||
|
||||
if (user) {
|
||||
response.notifications = user.notifications.map(notification => notification.toJSON());
|
||||
response.notifications = UserNotification.convertNotificationsToSafeJson(user.notifications);
|
||||
response.userV = user._v;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user