Skip to content

Commit 1d15a68

Browse files
committed
fix: fix duplicate table bugs
1 parent 53efb9a commit 1d15a68

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

apps/frontend/src/lib/components/blocks/base/duplicate-base.svelte

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,7 @@
108108
>
109109
Cancel
110110
</Button>
111-
<Form.Button
112-
disabled={$duplicateBaseMutation.isPending}
113-
on:click={() => {
114-
$duplicateBaseMutation.mutate({ id: base.id })
115-
}}
116-
>
111+
<Form.Button disabled={$duplicateBaseMutation.isPending}>
117112
{#if $duplicateBaseMutation.isPending}
118113
<LoaderCircleIcon class="mr-2 h-5 w-5 animate-spin" />
119114
{/if}

apps/frontend/src/lib/components/blocks/duplicate-table/duplicate-table.svelte

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
import { Input } from "$lib/components/ui/input"
1616
import { Checkbox } from "$lib/components/ui/checkbox"
1717
import * as Alert from "$lib/components/ui/alert"
18+
import { getTable } from "$lib/store/table.store"
1819
19-
export let table: TableDo
20+
const table = getTable()
2021
2122
const form = superForm(
2223
defaults(
2324
{
24-
tableId: table.id.value,
25+
tableId: $table.id.value,
2526
name: "",
2627
includeData: true,
2728
},
@@ -68,9 +69,9 @@
6869
>
6970
<Dialog.Content>
7071
<Dialog.Header>
71-
<Dialog.Title>Duplicate Table {table.name.value}</Dialog.Title>
72+
<Dialog.Title>Duplicate Table {$table.name.value}</Dialog.Title>
7273
<Dialog.Description>
73-
Create a new table with the same structure as {table.name.value}
74+
Create a new table with the same structure as {$table.name.value}
7475
</Dialog.Description>
7576
</Dialog.Header>
7677

apps/frontend/src/lib/components/blocks/table-header/table-header.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,4 @@
279279
</div>
280280
</header>
281281

282-
<DuplicateTable table={$table} />
282+
<DuplicateTable />

0 commit comments

Comments
 (0)