Skip to content

Commit

Permalink
feat: redirect organizer on workshop delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphico committed Jun 17, 2024
1 parent c27c0dd commit 5ce8a9f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/workshops/delete-workshop-alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from "react"
import { useRouter } from "next/navigation"
import { toast } from "sonner"

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

Expand All @@ -40,6 +42,7 @@ export function DeleteWorkshopAlert({
}

toast.success("Workshop Deleted")
router.push("/dashboard")
})
}

Expand Down

0 comments on commit 5ce8a9f

Please sign in to comment.