mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Remove name validation flash errors in inline-editing [SCI-10338]
This commit is contained in:
parent
bcfb04b236
commit
c2eb0f18c7
2 changed files with 5 additions and 3 deletions
|
@ -108,8 +108,10 @@ let inlineEditing = (function() {
|
||||||
if (response.status === 403) {
|
if (response.status === 403) {
|
||||||
HelperModule.flashAlertMsg(I18n.t('general.no_permissions'), 'danger');
|
HelperModule.flashAlertMsg(I18n.t('general.no_permissions'), 'danger');
|
||||||
} else if (response.status === 422) {
|
} else if (response.status === 422) {
|
||||||
HelperModule.flashAlertMsg(response.responseJSON.errors
|
const errors = response.responseJSON.errors || response.responseJSON;
|
||||||
? Object.values(response.responseJSON.errors).join(', ') : I18n.t('errors.general'), 'danger');
|
if (!errors) {
|
||||||
|
HelperModule.flashAlertMsg(I18n.t('errors.general'), 'danger');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!error) error = response.responseJSON.errors[fieldToUpdate];
|
if (!error) error = response.responseJSON.errors[fieldToUpdate];
|
||||||
container.addClass('error');
|
container.addClass('error');
|
||||||
|
|
|
@ -116,7 +116,7 @@ class ExperimentsController < ApplicationController
|
||||||
|
|
||||||
render json: { message: t('experiments.update.success_flash', experiment: @experiment.name) }, status: :ok
|
render json: { message: t('experiments.update.success_flash', experiment: @experiment.name) }, status: :ok
|
||||||
else
|
else
|
||||||
render json: { message: @experiment.errors.full_messages }, status: :unprocessable_entity
|
render json: { errors: @experiment.errors }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue