Skip to content

Commit

Permalink
Fixed enrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
Siem2l authored and Riscky committed Jun 17, 2020
1 parent c163e0d commit 7c61fae
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/assets/javascripts/members/activities/activities.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ function confirm_enroll(activity) {
cancelButtonText: I18n.t('members.activities.actions.cancel'),
}).then(
// on confirm
function () {
if (activity.has_un_enroll_date_passed())
confirm_un_enroll_date_passed(activity);
else {
activity.enroll();
}
function (result) {
if (result.value) {
if (activity.has_un_enroll_date_passed())
confirm_un_enroll_date_passed(activity);
else {
activity.enroll();
}
}
}
);
}
Expand Down Expand Up @@ -103,8 +105,8 @@ function confirm_un_enroll(activity) {

}).then(
// anonymous function, because this is set to the sweetalert
function () {
activity.un_enroll();
function (result) {
if(result.value)activity.un_enroll();
}
);
}
Expand All @@ -119,8 +121,8 @@ function confirm_update(activity) {
cancelButtonText: I18n.t('members.activities.actions.cancel'),
}).then(
// anonymous function, because this is set to the sweetalert
function () {
activity.edit_enroll();
function (result) {
if(result.value) activity.edit_enroll();
}
);
}
Expand Down

0 comments on commit 7c61fae

Please sign in to comment.