fuma 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,9 +9,10 @@ import { InputText } from "../input/index.js";
9
9
  import { useForm } from "../../validation/form.js";
10
10
  export let key;
11
11
  export let views;
12
- export let actionCreate = "?/create_view";
13
- export let actionUpdate = "?/create_view";
14
- export let actionDelete = "?/delete_view";
12
+ export let action = "";
13
+ export let actionCreate = "?/view_create";
14
+ export let actionUpdate = "?/view_update";
15
+ export let actionDelete = "?/view_delete";
15
16
  let dialog;
16
17
  const form = useForm({
17
18
  onSuccess() {
@@ -108,7 +109,11 @@ function getQuery({ searchParams }) {
108
109
  {/if}
109
110
  </h2>
110
111
 
111
- <form action={selectedView ? actionUpdate : actionCreate} method="post" use:enhance={form.submit}>
112
+ <form
113
+ action="{action}{selectedView ? actionUpdate : actionCreate}"
114
+ method="post"
115
+ use:enhance={form.submit}
116
+ >
112
117
  {#if selectedView}
113
118
  <input type="hidden" name="id" value={selectedView.id} />
114
119
  {/if}
@@ -124,7 +129,9 @@ function getQuery({ searchParams }) {
124
129
  <div class="mt-2 flex flex-row-reverse gap-2">
125
130
  <button class="btn"> Valider </button>
126
131
 
127
- <button formaction={actionDelete} class="btn btn-ghost text-error"> Supprimer </button>
132
+ <button formaction="{action}{actionDelete}" class="btn btn-ghost text-error">
133
+ Supprimer
134
+ </button>
128
135
  </div>
129
136
  </form>
130
137
  </Dialog>
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  name: string;
8
8
  query: string;
9
9
  }[];
10
+ action?: string | undefined;
10
11
  actionCreate?: string | undefined;
11
12
  actionUpdate?: string | undefined;
12
13
  actionDelete?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",