Merge pull request #7173 from sboursen-scinote/sb_SCI-10302

Unify Creation modals error handling [SCI-10302]
This commit is contained in:
aignatov-bio 2024-03-01 11:54:47 +01:00 committed by GitHub
commit 1695d793af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -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];
});
},
},

View file

@ -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) {