Last active
October 5, 2016 10:10
-
-
Save jacobjuul/484a17f7869ed2510b712f4ee216a925 to your computer and use it in GitHub Desktop.
Revisions
-
jacobjuul revised this gist
Oct 5, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ActivityView.js notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_USER, { payload: { activity }, sender: userId }); -
jacobjuul revised this gist
Oct 5, 2016 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ // ActivityView.js notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_USER, { payload: { activity: activity }, sender: userId @@ -9,7 +10,7 @@ notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_COACH, { reciever: activity.coachId }); // notficationHandler.js export const notificationSender = (notificationType, { sender, reciever, payload }) => { switch(notificationType) { case types.USER_JOINED_ACTIVITY_COACH: @@ -34,7 +35,7 @@ export const notificationSender = (notificationType, { sender, reciever, payload } }; // notificationMethods.js export function userUnjoinedActivity(notificationType, { sender, reciever, payload }) { const userId = user._id; -
jacobjuul revised this gist
Oct 5, 2016 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,15 @@ notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_USER, { payload: { activity: activity }, sender: userId }); notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_COACH, { payload: { activityId: activity._id }, sender: userId, reciever: activity.coachId }); export const notificationSender = (notificationType, { sender, reciever, payload }) => { switch(notificationType) { case types.USER_JOINED_ACTIVITY_COACH: -
jacobjuul revised this gist
Oct 5, 2016 . No changes.There are no files selected for viewing
-
jacobjuul revised this gist
Oct 5, 2016 . 1 changed file with 28 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,4 +20,31 @@ export const notificationSender = (notificationType, { sender, reciever, payload default: break; } }; export function userUnjoinedActivity(notificationType, { sender, reciever, payload }) { const userId = user._id; if (notificationType === types.USER_UNJOINED_ACTIVITY_USER) // send notification to user Notification.insert({ createdBy: sender, targetId: sender, type: notificationType, data: payload.activity, message: `Du har afmeldt dig fra ${payload.activity.title}`, activityId: payload.activity._id }); } else { // send notification to coach Notification.insert({ createdBy: sender, targetId: reciever, type: notificationType, data: payload.activity, message: `Du har afmeldt dig fra ${payload.activity.title}`, activityId: payload.activity._id }); } } -
jacobjuul created this gist
Oct 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ export const notificationSender = (notificationType, { sender, reciever, payload }) => { switch(notificationType) { case types.USER_JOINED_ACTIVITY_COACH: break; case types.USER_JOINED_ACTIVITY_USER: break; case types.USER_UNJOINED_ACTIVITY_COACH: userUnjoinedActivity(notificationType, { sender, reciever, payload }); break; case types.USER_UNJOINED_ACTIVITY_USER: userUnjoinedActivity(notificationType, { sender, reciever, payload }); break; case types.USER_ENQUIRED_PACKAGE_COACH: break; default: break; } };