laravel-precognition-react-inertia
Advanced tools
Comparing version 0.5.10 to 0.5.11
@@ -133,12 +133,7 @@ import { toSimpleValidationErrors, resolveUrl, resolveMethod } from 'laravel-precognition'; | ||
submit(submitMethod = {}, submitUrl, submitOptions) { | ||
const isPatchedCall = typeof submitMethod !== 'string'; | ||
submitOptions = isPatchedCall | ||
? submitMethod | ||
: submitOptions; | ||
submitUrl = isPatchedCall | ||
? resolveUrl(url) | ||
: submitUrl; | ||
submitMethod = isPatchedCall | ||
? resolveMethod(method) | ||
: submitMethod; | ||
if (typeof submitMethod !== 'string') { | ||
submitOptions = submitMethod; | ||
submitUrl = resolveUrl(url); | ||
submitMethod = resolveMethod(method); | ||
} | ||
inertiaSubmit(submitMethod, submitUrl, { | ||
@@ -148,3 +143,3 @@ ...submitOptions, | ||
precognitiveForm.validator().setErrors(errors); | ||
if (submitOptions.onError) { | ||
if (submitOptions?.onError) { | ||
return submitOptions.onError(errors); | ||
@@ -151,0 +146,0 @@ } |
{ | ||
"name": "laravel-precognition-react-inertia", | ||
"version": "0.5.10", | ||
"version": "0.5.11", | ||
"description": "Laravel Precognition (React w/ Inertia).", | ||
@@ -35,4 +35,4 @@ "keywords": [ | ||
"dependencies": { | ||
"laravel-precognition": "0.5.10", | ||
"laravel-precognition-react": "0.5.10" | ||
"laravel-precognition": "0.5.11", | ||
"laravel-precognition-react": "0.5.11" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
9300
155
+ Addedlaravel-precognition@0.5.11(transitive)
+ Addedlaravel-precognition-react@0.5.11(transitive)
- Removedlaravel-precognition@0.5.10(transitive)
- Removedlaravel-precognition-react@0.5.10(transitive)
Updatedlaravel-precognition@0.5.11