VRFS-2263 added special handling for attempts to join session multiple times

This commit is contained in:
Jonathan Kolyer 2014-10-10 19:16:25 +00:00
parent f06ef0c716
commit 5564fd2cf7
1 changed files with 10 additions and 1 deletions

View File

@ -222,7 +222,16 @@
rest.createJoinRequest(joinRequest)
.done(function(response) {
}).error(context.JK.app.ajaxError);
}).error(function(jqXHR, textStatus, errorMessage) {
var joinErr = jqXHR.responseJSON['errors']
if (joinErr && joinErr['user_id'] == 'has already been taken') {
context.JK.app.notify({title: "Oops!",
text: 'You have already requested to join this session.',
"icon_url": "/assets/content/icon_alert_big.png"});
} else {
context.JK.app.ajaxError(jqXHR, textStatus, errorMessage);
}
});
context.JK.app.layout.closeDialog('alert');
}