diff --git a/src/app/(main)/dashboard/page.tsx b/src/app/(main)/dashboard/page.tsx index ac1db4a..d259047 100644 --- a/src/app/(main)/dashboard/page.tsx +++ b/src/app/(main)/dashboard/page.tsx @@ -4,6 +4,7 @@ import { Suspense } from "react"; import { getServerI18n } from "@/i18n"; import DashboardPage from "@/components/DashboardPage"; import { SearchParams } from "@/app/utils/fetchUtil"; +import { fetchEscalationLogsByUser } from "@/app/api/escalation"; export const metadata: Metadata = { title: "Dashboard", @@ -14,6 +15,8 @@ type Props = {} & SearchParams; const Dashboard: React.FC = async ({ searchParams }) => { const { t } = await getServerI18n("dashboard"); + fetchEscalationLogsByUser() + return ( }> diff --git a/src/app/api/dashboard/index.ts b/src/app/api/dashboard/index.ts index 2bbb799..4b7ba4e 100644 --- a/src/app/api/dashboard/index.ts +++ b/src/app/api/dashboard/index.ts @@ -84,7 +84,8 @@ export const fetchPoWithStockInLines = cache(async (id: number) => { }); export const fetchIqcLogByUser = cache(async () => { - return serverFetchJson(`${BASE_API_URL}/supervisionApprovalLog/stock-in`, { - next: { tags: ["qcLog"] }, - }); + // return serverFetchJson(`${BASE_API_URL}/supervisionApprovalLog/stock-in`, { + // next: { tags: ["qcLog"] }, + // }); + return undefined; }); diff --git a/src/components/DashboardPage/DashboardPage.tsx b/src/components/DashboardPage/DashboardPage.tsx index 23c7a15..e675775 100644 --- a/src/components/DashboardPage/DashboardPage.tsx +++ b/src/components/DashboardPage/DashboardPage.tsx @@ -15,12 +15,15 @@ import OrderCompletionChart from "./chart/OrderCompletionChart"; import DashboardBox from "./Dashboardbox"; import CollapsibleCard from "./CollapsibleCard"; import SupervisorQcApproval, { IQCItems } from "./QC/SupervisorQcApproval"; +import { EscalationResult } from "@/app/api/escalation"; type Props = { - iqc: IQCItems[] + // iqc: IQCItems[] | undefined + escalationLogs: EscalationResult[] }; const DashboardPage: React.FC = ({ - iqc + // iqc, + escalationLogs }) => { const { t } = useTranslation("dashboard"); const router = useRouter(); @@ -31,7 +34,7 @@ const DashboardPage: React.FC = ({ - + diff --git a/src/components/DashboardPage/DashboardWrapper.tsx b/src/components/DashboardPage/DashboardWrapper.tsx index 4b35ed1..234ba23 100644 --- a/src/components/DashboardPage/DashboardWrapper.tsx +++ b/src/components/DashboardPage/DashboardWrapper.tsx @@ -4,7 +4,8 @@ import DashboardPage from "./DashboardPage"; import { Typography } from "@mui/material"; import { I18nProvider, getServerI18n } from "@/i18n"; import DashboardLoading from "./DashboardLoading"; -import { fetchIqcLogByUser } from "@/app/api/dashboard"; +import { fetchEscalationLogsByUser } from "@/app/api/escalation"; +// import { fetchIqcLogByUser } from "@/app/api/dashboard"; // export type SessionWithAbilities = { // abilities: string[] @@ -23,16 +24,20 @@ const DashboardWrapper: React.FC & SubComponents = async ({ }) => { const { t } = await getServerI18n("dashboard"); // const session: SessionWithAbilities = await getServerSession(authOptions) - const [iqcLog] = await Promise.all([ - fetchIqcLogByUser() + // const [iqcLog] = await Promise.all([ + // fetchIqcLogByUser() + // ]) + + const [escalationLogs] = await Promise.all([ + fetchEscalationLogsByUser() ]) - console.log(iqcLog) return ( <> {t("Dashboard")}