diff --git a/apps/wr/app/api/common-codes/route.ts b/apps/wr/app/api/common-codes/route.ts index ded38eadf..aa62b261b 100644 --- a/apps/wr/app/api/common-codes/route.ts +++ b/apps/wr/app/api/common-codes/route.ts @@ -1,7 +1,8 @@ +export const dynamic = "force-dynamic"; import { SITE_ID } from "@/src/shared/config"; import { NextResponse } from "next/server"; -export const revalidate = 60 * 60 * 24; +export const revalidate = 86400; //60 * 60 * 24; type SelectDataType = { text: string; diff --git a/apps/wr/app/store/map/pbnstMap/index.tsx b/apps/wr/app/store/map/pbnstMap/index.tsx index 18f9abfe2..80eb2697a 100644 --- a/apps/wr/app/store/map/pbnstMap/index.tsx +++ b/apps/wr/app/store/map/pbnstMap/index.tsx @@ -9,13 +9,15 @@ import { excelHasuMapParsing } from "./excel"; export const pbnMapTableSize = 20; const hasuListFetch = async ( + get: any, + set: any, page: number, pageTotal: number, reurnValue: ReturnType, searchNm?: string ) => { let url = `/prcsFclt/ruseInfo/${page}/${pageTotal}/`; - const checkWrRegListRes = await checkWrRegList(); + const checkWrRegListRes = await checkWrRegList(get, set); if (reurnValue.partValue === "A") { url += `${reurnValue.partValue}/${ @@ -92,7 +94,7 @@ export const pbnMapStateExport: pbnMapState = { }, }; -export const pbnMapActionsExport: (set: any) => pbnMapActions = (set: any) => { +export const pbnMapActionsExport: (set: any, get: any) => pbnMapActions = (set: any, get: any) => { return { pbnMapInit: async ( page: number, @@ -100,7 +102,7 @@ export const pbnMapActionsExport: (set: any) => pbnMapActions = (set: any) => { reurnValue: ReturnType ) => { try { - const pubMapRes = await hasuListFetch(page, pageTotal, reurnValue); + const pubMapRes = await hasuListFetch(get, set, page, pageTotal, reurnValue); set((state: pbnMapState) => { return { ...state, @@ -144,7 +146,7 @@ export const pbnMapActionsExport: (set: any) => pbnMapActions = (set: any) => { txt: string, ) => { try { - const hasuMapRes = await hasuListFetch(page, pageTotal, reurnValue, txt); + const hasuMapRes = await hasuListFetch(get, set, page, pageTotal, reurnValue, txt); if (isExcel) { const hasuMapExcelList = excelHasuMapParsing( hasuMapRes diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index c90fc18bf..268be198b 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -2,13 +2,6 @@ import { createStore } from "zustand/vanilla"; import { codeActionExport, comCodeStateExport, - getCityCd, - getCommonUpCd, - getEnvPartCd, - getMiddleRegionCd, - getRegionCd, - getSggCd, - getUnitWaterShedCd, type comCodeState, type comCodeType, } from "./common/code"; @@ -373,7 +366,7 @@ export const StoreZus = ( ...rswtStatActionsExport(set), ...authActionsExport(set,get), ...commonMapActionsExport(set), - ...pbnMapActionsExport(set), + ...pbnMapActionsExport(set, get), ...rainMapActionsExport(set), ...rswtMapActionsExport(set), ...htdfMapActionsExport(set),