Skip to content

Commit 9e0b618

Browse files
committed
Fix violations display on creation modal
1 parent b746619 commit 9e0b618

File tree

1 file changed

+8
-2
lines changed
  • Resources/public/js/form/creation

1 file changed

+8
-2
lines changed

Resources/public/js/form/creation/modal.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ define(
6666
type: 'POST',
6767
data: JSON.stringify(data)
6868
}).fail(function (response) {
69-
const errors = response.responseJSON ?
69+
if (response.responseJSON) {
70+
this.getRoot().trigger(
71+
'pim_enrich:form:entity:bad_request',
72+
{'sentData': this.getFormData(), 'response': response.responseJSON.values}
73+
);
74+
}
75+
76+
this.validationErrors = response.responseJSON ?
7077
this.normalize(response.responseJSON) : [{message: __('error.common')}];
71-
this.validationErrors = errors;
7278
this.render();
7379
}.bind(this))
7480
.always(() => loadingMask.remove());

0 commit comments

Comments
 (0)