Skip to content

Commit 5ce8a9f

Browse files
committed
feat: redirect organizer on workshop delete
1 parent c27c0dd commit 5ce8a9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/workshops/delete-workshop-alert.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from "react"
2+
import { useRouter } from "next/navigation"
23
import { toast } from "sonner"
34

45
import { deleteWorkshopAction } from "@/server/actions/workshop"
@@ -28,6 +29,7 @@ export function DeleteWorkshopAlert({
2829
setShowDeleteWorkshopAlert: React.Dispatch<React.SetStateAction<boolean>>
2930
props: DeleteWorkshopAlertProps
3031
}) {
32+
const router = useRouter()
3133
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3234
const [_, startTransition] = React.useTransition()
3335

@@ -40,6 +42,7 @@ export function DeleteWorkshopAlert({
4042
}
4143

4244
toast.success("Workshop Deleted")
45+
router.push("/dashboard")
4346
})
4447
}
4548

0 commit comments

Comments
 (0)