mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 15:36:22 +08:00
Merge pull request #5244 from artoscinote/ma_SCI_8246
Add display of validation errors to TinyMCE [SCI-8246]
This commit is contained in:
commit
cc38619514
|
@ -348,7 +348,7 @@ class MyModulesController < ApplicationController
|
|||
|
||||
render json: protocol, serializer: ProtocolSerializer, user: current_user
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
head :unprocessable_entity
|
||||
render json: protocol.errors, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
def results
|
||||
|
|
2
app/javascript/packs/tiny_mce.js
vendored
2
app/javascript/packs/tiny_mce.js
vendored
|
@ -343,6 +343,8 @@ window.TinyMCE = (() => {
|
|||
editor.setProgressState(0);
|
||||
if (data.status === 403) {
|
||||
HelperModule.flashAlertMsg(I18n.t('general.no_permissions'), 'danger');
|
||||
} else if (data.status === 422) {
|
||||
HelperModule.flashAlertMsg(data.responseJSON ? Object.values(data.responseJSON).join(', ') : I18n.t('errors.general'), 'danger');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue