Skip to content

Commit

Permalink
fix: fix delete base ux
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Aug 20, 2024
1 parent 1039b02 commit e84d77c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@
)
const { enhance, form: formData } = form
let open = false
const deleteSpaceMutation = createMutation({
mutationFn: trpc.base.delete.mutate,
onError(error, variables, context) {
toast.error(error.message)
},
async onSuccess() {
toast.success("Base deleted successfully")
await invalidateAll()
open = false
goto("/")
},
})
Expand Down Expand Up @@ -95,7 +101,7 @@
<p class="text-red-500">Danger Zone</p>
<div>Delete Base</div>

<AlertDialog.Root>
<AlertDialog.Root bind:open>
<AlertDialog.Trigger asChild let:builder>
<Button variant="destructive" builders={[builder]} disabled={!$hasPermission("base:delete")}>
Delete Base
Expand Down

0 comments on commit e84d77c

Please sign in to comment.