Skip to content

Commit 4808de4

Browse files
committed
fix: delete RemoteFormAllIssue, add path to RemoteFormIssue
1 parent 6cee4c3 commit 4808de4

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
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
};

0 commit comments

Comments
 (0)