setError
doesn't work as expected, returns key
instead of the key provided
#96
Labels
setError
doesn't work as expected, returns key
instead of the key provided
#96
Laravel Precognition Plugin Version
0.5.8
Laravel Version
11.0
Plugin
Vue w/ Inertia
Description
The
form.setError
doesn't work as it does with the InertiauseForm
helper.I want to do a quick front-end validation before I send the data on the server, in cases where the user can't add some data if some other data is empty.
I noticed that when using the
laravel-precognition-vue-inertia'
the errors aren't shown, and that's because the form errors object is like this:from the Vue Developer tools. Normally should be
{ 'shipping_cost': "Shipping Cost is required" }
as the function is called like this:form.setError('shipping_cost', 'Shipping Cost is required')
.I debugged it and noticed that for some reason, the object is returned with
key
instead of the input name:Steps To Reproduce
laravel-precognition-vue-inertia
useForm
setError
functionThe text was updated successfully, but these errors were encountered: