Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aviemet/useInertiaForm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.1
Choose a base ref
...
head repository: aviemet/useInertiaForm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.2
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Apr 8, 2023

  1. Copy the full SHA
    834d2d2 View commit details
  2. Copy the full SHA
    f125846 View commit details
  3. chore(release): 3.1.2 [skip ci]

    ## [3.1.2](v3.1.1...v3.1.2) (2023-04-08)
    
    ### Bug Fixes
    
    * 🐛 Adds path typings to clearErrors ([834d2d2](834d2d2))
    semantic-release-bot committed Apr 8, 2023
    Copy the full SHA
    7cb87c4 View commit details
Showing with 12 additions and 2 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +4 −1 src/useInertiaForm.ts
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.1.2](https://github.com/aviemet/useInertiaForm/compare/v3.1.1...v3.1.2) (2023-04-08)


### Bug Fixes

* 🐛 Adds path typings to clearErrors ([834d2d2](https://github.com/aviemet/useInertiaForm/commit/834d2d2127cb28b5859332751b499d427a7ca524))

## [3.1.1](https://github.com/aviemet/useInertiaForm/compare/v3.1.0...v3.1.1) (2023-04-08)


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-inertia-form",
"version": "3.1.1",
"version": "3.1.2",
"description": "Extra functionality for Inertia.js useForm hook",
"main": "dist/useInertiaForm.js",
"module": "dist/useInertiaForm.esm.js",
5 changes: 4 additions & 1 deletion src/useInertiaForm.ts
Original file line number Diff line number Diff line change
@@ -43,6 +43,9 @@ type setErrorByObject = (errors: Record<string, string|string[]>) => void
type getErrorByPath<TForm> = (field: Path<TForm>) => string|string[]|undefined
type getErrorByString = (field: string) => string|string[]|undefined

type clearErrorsByPath<TForm> = (field: Path<TForm>|Path<TForm>[]) => void
type clearErrorsByString = (field: string|string[]) => void

export interface UseInertiaFormProps<TForm> {
data: TForm
isDirty: boolean
@@ -61,7 +64,7 @@ export interface UseInertiaFormProps<TForm> {
setDefaults(field: string, value: string): void
setDefaults(fields: TForm): void
reset: resetAll & resetByPath<TForm> & resetByString
clearErrors: (fields?: string|string[]) => void
clearErrors: clearErrorsByPath<TForm> & clearErrorsByString
setError: setErrorByPath<TForm> & setErrorByString & setErrorByObject
getError: getErrorByPath<TForm> & getErrorByString
submit: (method: Method, url: string, options?: VisitOptions) => void