Skip to content

Commit

Permalink
SWIK-1684 Resolved some lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaun committed Nov 10, 2017
1 parent c8c439a commit 96a85b0
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions application/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,24 @@ let self = module.exports = {

let id = request.payload.id;
if (id === 'Sfn87Pfew9Af09aM') {//PERFORM RECREATION OF NOTIFICATIONS

activitiesDB.getAllFromCollection()
.then((activities) => {
activities.forEach((activity) => {
const existingNotification = notifications.find((notification) => {return notification.activity_id === activities._id;});
if (existingNotification === undefined) {//it was marked as read (deleted from the notifications-service)
recreateNotification(activity);
console.log('recreated notification, activity_id=' + activity._id);
}
});
}).catch((error) => {
console.log('db problem with recreation of notifications: ' + error);
rp.get({uri: Microservices.notification.uri + '/notifications/-1'})//get all notifications
.then((notifications) => {

activitiesDB.getAllFromCollection()
.then((activities) => {
activities.forEach((activity) => {
const existingNotification = notifications.find((notification) => {return notification.activity_id === activities._id;});
if (existingNotification === undefined) {//it was marked as read (deleted from the notifications-service)
recreateNotification(activity);
console.log('recreated notification, activity_id=' + activity._id);
}
});
}).catch((error) => {
console.log('db problem with recreation of notifications: ' + error);
});
})
.catch((error) => {
console.log('notifications service problem with recreation of notifications: ' + error);
});
}

Expand Down

0 comments on commit 96a85b0

Please sign in to comment.