File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
1616- It wasn't possible to directly assign ` undefined ` to a field in the ` $errors ` store.
1717- Intersections in Zod schemas weren't handled properly.
18+ - It wasn't possible to change the reference to the result in ` onResult ` .
1819
1920## [ 2.7.0] - 2024-03-03
2021
Original file line number Diff line number Diff line change @@ -1778,7 +1778,7 @@ export function superForm<
17781778 currentRequest = null ;
17791779
17801780 // Check if an error was thrown in hooks, in which case it has no type.
1781- const result : ActionResult = event . result . type
1781+ let result : ActionResult = event . result . type
17821782 ? event . result
17831783 : {
17841784 type : 'error' ,
@@ -1805,6 +1805,9 @@ export function superForm<
18051805 await event ( data ) ;
18061806 }
18071807
1808+ // In case it was modified in the event
1809+ result = data . result ;
1810+
18081811 if ( ! cancelled ) {
18091812 if ( ( result . type === 'success' || result . type == 'failure' ) && result . data ) {
18101813 const forms = Context_findValidationForms ( result . data ) ;
You can’t perform that action at this time.
0 commit comments