Skip to content

Commit bb16a8f

Browse files
authored
fix: delete RemoteFormAllIssue, add path to RemoteFormIssue (#14864)
* fix: delete `RemoteFormAllIssue`, add `path` to `RemoteFormIssue` * regenerate
1 parent 6cee4c3 commit bb16a8f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.changeset/twenty-papers-unite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: delete `RemoteFormAllIssue`, add `path` to `RemoteFormIssue`

packages/kit/src/exports/public.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,12 +1911,12 @@ export type RemoteFormField<Value extends RemoteFormFieldValue> = RemoteFormFiel
19111911

19121912
type RemoteFormFieldContainer<Value> = RemoteFormFieldMethods<Value> & {
19131913
/** Validation issues belonging to this or any of the fields that belong to it, if any */
1914-
allIssues(): RemoteFormAllIssue[] | undefined;
1914+
allIssues(): RemoteFormIssue[] | undefined;
19151915
};
19161916

19171917
type UnknownField<Value> = RemoteFormFieldMethods<Value> & {
19181918
/** Validation issues belonging to this or any of the fields that belong to it, if any */
1919-
allIssues(): RemoteFormAllIssue[] | undefined;
1919+
allIssues(): RemoteFormIssue[] | undefined;
19201920
/**
19211921
* Returns an object that can be spread onto an input element with the correct type attribute,
19221922
* aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters.
@@ -1963,9 +1963,6 @@ export interface RemoteFormInput {
19631963

19641964
export interface RemoteFormIssue {
19651965
message: string;
1966-
}
1967-
1968-
export interface RemoteFormAllIssue extends RemoteFormIssue {
19691966
path: Array<string | number>;
19701967
}
19711968

packages/kit/src/runtime/form-utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export function create_field_proxy(target, get_input, set_input, get_issues, pat
255255
return all_issues
256256
?.filter((issue) => issue.name === key)
257257
?.map((issue) => ({
258+
path: issue.path,
258259
message: issue.message
259260
}));
260261
};

packages/kit/types/index.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,12 +1887,12 @@ declare module '@sveltejs/kit' {
18871887

18881888
type RemoteFormFieldContainer<Value> = RemoteFormFieldMethods<Value> & {
18891889
/** Validation issues belonging to this or any of the fields that belong to it, if any */
1890-
allIssues(): RemoteFormAllIssue[] | undefined;
1890+
allIssues(): RemoteFormIssue[] | undefined;
18911891
};
18921892

18931893
type UnknownField<Value> = RemoteFormFieldMethods<Value> & {
18941894
/** Validation issues belonging to this or any of the fields that belong to it, if any */
1895-
allIssues(): RemoteFormAllIssue[] | undefined;
1895+
allIssues(): RemoteFormIssue[] | undefined;
18961896
/**
18971897
* Returns an object that can be spread onto an input element with the correct type attribute,
18981898
* aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters.
@@ -1939,9 +1939,6 @@ declare module '@sveltejs/kit' {
19391939

19401940
export interface RemoteFormIssue {
19411941
message: string;
1942-
}
1943-
1944-
export interface RemoteFormAllIssue extends RemoteFormIssue {
19451942
path: Array<string | number>;
19461943
}
19471944

0 commit comments

Comments
 (0)