From a239b8fc996904947d5fde7a02e96ba7c2063f3a Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:58:50 +0200 Subject: [PATCH] Prevent Form object to reject error on 422 response --- resources/js_vue3/components/formElements/Form.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/js_vue3/components/formElements/Form.js b/resources/js_vue3/components/formElements/Form.js index f5a2984d..eb1e3db7 100644 --- a/resources/js_vue3/components/formElements/Form.js +++ b/resources/js_vue3/components/formElements/Form.js @@ -195,8 +195,9 @@ class Form { if (error.response) { this.errors.set(this.extractErrors(error.response)) } - - reject(error) + if (error.response?.status != 422) { + reject(error) + } }) }) } @@ -226,8 +227,9 @@ class Form { if (error.response) { this.errors.set(this.extractErrors(error.response)) } - - reject(error) + if (error.response?.status != 422) { + reject(error) + } }) }) }