mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
Add experiment move error handling to project show [SCI-6398] (#3776)
Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
parent
354bf4b808
commit
2e4f687d31
1 changed files with 16 additions and 0 deletions
|
@ -236,6 +236,22 @@
|
|||
modal.on('hidden.bs.modal', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
validateMoveModal(modal)
|
||||
}
|
||||
|
||||
function validateMoveModal(modal) {
|
||||
if (modal[0].id.match(/move-experiment-modal-[0-9]*/)) {
|
||||
let form = $(modal).find('form');
|
||||
form.on('ajax:success', function(e, data) {
|
||||
animateSpinner(form, true);
|
||||
window.location.replace(data.path);
|
||||
}).on('ajax:error', function(e, error) {
|
||||
animateSpinner(form, false);
|
||||
form.clearFormErrors();
|
||||
let msg = JSON.parse(error.responseText);
|
||||
renderFormError(e, form.find('#experiment_project_id'), msg.message.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue