mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-25 01:04:02 +08:00
Merge pull request #7173 from sboursen-scinote/sb_SCI-10302
Unify Creation modals error handling [SCI-10302]
This commit is contained in:
commit
1695d793af
2 changed files with 4 additions and 3 deletions
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<label class="sci-label">{{ i18n.t('experiments.new.name') }}</label>
|
||||
<div class="sci-input-container-v2 mb-4">
|
||||
<div class="sci-input-container-v2 mb-6" :class="{'error': error}" :data-error="error">
|
||||
<input type="text" class="sci-input-field"
|
||||
v-model="name"
|
||||
autofocus ref="input"
|
||||
|
@ -54,6 +54,7 @@ export default {
|
|||
return {
|
||||
name: '',
|
||||
description: '',
|
||||
error: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -76,7 +77,7 @@ export default {
|
|||
this.$emit('create');
|
||||
window.location.replace(response.data.path);
|
||||
}).catch((error) => {
|
||||
HelperModule.flashAlertMsg(error.response.data.message, 'danger');
|
||||
this.error = error.response.data.name[0];
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -81,7 +81,7 @@ export default {
|
|||
this.error = null;
|
||||
this.$emit('create');
|
||||
}).catch((error) => {
|
||||
this.error = error.response.data.name;
|
||||
this.error = error.response.data.error;
|
||||
});
|
||||
},
|
||||
changeRole(role) {
|
||||
|
|
Loading…
Reference in a new issue