File tree Expand file tree Collapse file tree 2 files changed +28
-20
lines changed
src/routes/(v2)/v2/component-ondestroy Expand file tree Collapse file tree 2 files changed +28
-20
lines changed Original file line number Diff line number Diff line change @@ -17,27 +17,31 @@ const grids = [
17
17
{
18
18
id : 3 ,
19
19
values : [ 7 , 8 , 9 ]
20
- } ,
21
- ]
20
+ }
21
+ ] ;
22
22
23
23
export const actions : Actions = {
24
24
async default ( { request } ) {
25
- console . log ( 'push' )
25
+ console . log ( 'push' ) ;
26
26
grids . push ( {
27
27
id : 3 ,
28
28
values : [ 7 , 8 , 9 ]
29
- } )
29
+ } ) ;
30
30
31
- return { success : true }
31
+ return { success : true } ;
32
32
}
33
- }
33
+ } ;
34
34
35
35
export const load : PageServerLoad = async ( ) => {
36
- const grid_forms = await Promise . all ( grids . map ( ( grid ) => superValidate ( grid , zod ( schema ) , {
37
- id : grid . id . toString ( )
38
- } ) ) )
36
+ const grid_forms = await Promise . all (
37
+ grids . map ( ( grid ) =>
38
+ superValidate ( grid , zod ( schema ) , {
39
+ id : grid . id . toString ( )
40
+ } )
41
+ )
42
+ ) ;
39
43
40
- console . log ( grid_forms . length )
44
+ console . log ( grid_forms . length ) ;
41
45
42
- return { grid_forms }
46
+ return { grid_forms } ;
43
47
} ;
Original file line number Diff line number Diff line change 2
2
import { page } from ' $app/stores' ;
3
3
import type { PageData } from ' ./$types' ;
4
4
import { superForm } from ' $lib/index.js' ;
5
- import Form from ' ./Form.svelte'
5
+ import Form from ' ./Form.svelte' ;
6
6
import { enhance } from ' $app/forms' ;
7
7
8
8
let {
9
9
data
10
10
}: {
11
11
data: PageData ;
12
12
} = $props ();
13
-
14
- const superforms = $derived (data .grid_forms .map (grid_form => superForm (grid_form , {
15
- dataType: ' json'
16
- })))
13
+
14
+ const superforms = $derived (
15
+ data .grid_forms .map ((grid_form ) =>
16
+ superForm (grid_form , {
17
+ dataType: ' json'
18
+ })
19
+ )
20
+ );
17
21
</script >
18
22
19
23
{#each superforms as form }
20
- <Form {form }/>
24
+ <Form {form } />
21
25
{/each }
22
26
23
- <form method =post use:enhance >
24
- <button type =submit >Add</button >
25
- </form >
27
+ <form method =" post" use:enhance >
28
+ <button type =" submit" >Add</button >
29
+ </form >
You can’t perform that action at this time.
0 commit comments