Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsm412 committed Jul 10, 2024
1 parent e1b9cd0 commit f54b801
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rair-node/bin/api/notifications/notifications.Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ module.exports = {
markNotificationAsRead: async (req, res, next) => {
try {
const { publicAddress } = req.user;
const { ids } = req.body;
const { ids = [] } = req.body;
const filter = {
user: publicAddress,
};
if (ids.length) {
if (ids?.length) {
filter._id = { $in: ids };
}
const result = await Notification.updateMany(
Expand All @@ -117,11 +117,11 @@ module.exports = {
deleteNotification: async (req, res, next) => {
try {
const { publicAddress } = req.user;
const { ids } = req.body;
const { ids = [] } = req.body;
const filter = {
user: publicAddress,
};
if (ids.length) {
if (ids?.length) {
filter._id = { $in: ids };
}
const result = await Notification.deleteMany(filter);
Expand Down

0 comments on commit f54b801

Please sign in to comment.