mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 15:45:34 +08:00
Fix user leaving the workspace [SCI-12211]
This commit is contained in:
parent
cc0f950077
commit
d35da236cd
2 changed files with 8 additions and 2 deletions
|
@ -150,7 +150,11 @@
|
||||||
if (data.status === 'done') {
|
if (data.status === 'done') {
|
||||||
// Reload the whole table
|
// Reload the whole table
|
||||||
HelperModule.flashAlertMsg(jobData.success_message, 'success');
|
HelperModule.flashAlertMsg(jobData.success_message, 'success');
|
||||||
|
if(jobData.redirect_url) {
|
||||||
|
window.location.href = jobData.redirect_url;
|
||||||
|
} else {
|
||||||
usersDatatable.ajax.reload();
|
usersDatatable.ajax.reload();
|
||||||
|
}
|
||||||
animateSpinner(null, false);
|
animateSpinner(null, false);
|
||||||
$('#destroy-user-team-modal').modal('hide');
|
$('#destroy-user-team-modal').modal('hide');
|
||||||
clearInterval(jobStatusInterval);
|
clearInterval(jobStatusInterval);
|
||||||
|
|
|
@ -109,11 +109,13 @@ module Users
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
redirect_url = teams_path if params[:leave]
|
||||||
|
|
||||||
generate_notification(current_user,
|
generate_notification(current_user,
|
||||||
@user_assignment.user,
|
@user_assignment.user,
|
||||||
@user_assignment.assignable,
|
@user_assignment.assignable,
|
||||||
false)
|
false)
|
||||||
render json: { status: :ok, job_id: job_id, success_message: success_message }
|
render json: { status: :ok, job_id: job_id, success_message: success_message, redirect_url: redirect_url }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue