amrnn90 / breeze-nuxt

An application / authentication starter kit frontend in Nuxt3 for Laravel Breeze.
MIT License
198 stars 33 forks source link

useSubmit validationErrors available until nextTick #28

Open carlosvaldesweb opened 8 months ago

carlosvaldesweb commented 8 months ago

Hello, if we want to access to validationErrors in onError function in usesubmit, we need to use NextTick, to fix it we need to swap this lines from:

options?.onError?.(e);
validationErrors.value = e.data?.errors ?? {};

to:

validationErrors.value = e.data?.errors ?? {};
options?.onError?.(e);