fix bugs phase 2 (excel ) , download sample feature
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect } from "react"
|
||||
import { use } from "react"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation"
|
||||
import { ResourcePage } from "@/shared/data-view/resource-page"
|
||||
import { ColumnHeader } from "@/shared/data-view/table-view"
|
||||
import FormDialog from "@/shared/components/form-dialog"
|
||||
@@ -27,8 +28,20 @@ export default function JobCardAppointmentsPage({
|
||||
}) {
|
||||
const { id: jobCardId } = use(params)
|
||||
const router = useRouter()
|
||||
const pathname = usePathname()
|
||||
const searchParams = useSearchParams()
|
||||
const jobCard = useJobCard()
|
||||
|
||||
useEffect(() => {
|
||||
if (searchParams.get("create") !== "1") return
|
||||
|
||||
const params = new URLSearchParams(searchParams.toString())
|
||||
params.delete("create")
|
||||
params.set("dialog", "true")
|
||||
|
||||
router.replace(`${pathname}?${params.toString()}`)
|
||||
}, [pathname, router, searchParams])
|
||||
|
||||
const defaultJobCard = jobCard
|
||||
? { value: String((jobCard as any).id), label: (jobCard as any).label || (jobCard as any).title || `Job Card` }
|
||||
: null
|
||||
|
||||
Reference in New Issue
Block a user