Skip to content

Commit eab2ca3

Browse files
committed
chore: error toast on create table error
1 parent 2710477 commit eab2ca3

File tree

1 file changed

+4
-0
lines changed
  • apps/frontend/src/routes/(template)/create-from-template/[spaceId]/[baseId]

1 file changed

+4
-0
lines changed

apps/frontend/src/routes/(template)/create-from-template/[spaceId]/[baseId]/+page.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import { page } from "$app/stores"
1616
import type { PageData } from "./$types"
1717
import * as Select from "$lib/components/ui/select/index.js"
18+
import { toast } from "svelte-sonner"
1819
1920
export let data: PageData
2021
@@ -27,6 +28,9 @@
2728
2829
const createFromTemplateMutation = createMutation({
2930
mutationFn: trpc.base.createFromTemplate.mutate,
31+
onError(error, variables, context) {
32+
toast.error(error.message)
33+
},
3034
async onSuccess(data, variables, context) {
3135
await goto(`/bases/${data}`)
3236
},

0 commit comments

Comments
 (0)