diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index f818a494f..86dce20d6 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -28,6 +28,7 @@ import { z } from "zod"; import { PbnstRegModal } from "@/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal"; import { Toaster } from "react-hot-toast"; import { ToastFormUi } from "@/components/ui/toast/toastFromUi"; +import { writeRgtrAndMdfr } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg"; export default function PublicReuseFaciltyInsert() { const { @@ -38,6 +39,8 @@ export default function PublicReuseFaciltyInsert() { pbnstRegClick, getSwtrmtFcltNm, pbnstMngData, + pbnstRuseFcltUpdate, + pbnstRuseBizUpdate, } = useWrStore((state) => state); const { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst; const [currentTab, setCurrentTab] = useState("mng"); @@ -51,12 +54,35 @@ export default function PublicReuseFaciltyInsert() { const [bdstTable, setbdstTable] = useState(); const [selectBdst, setSelectBdst] = useState(null); + useEffect(() => { if (!pbnst.isInit) { pubHasuInit("1", "11"); } }, [pbnst.isInit, pubHasuInit]); + + + const saveRuseData = async ()=>{ + const data = writeRgtrAndMdfr(pbnst.pbnstMngRegData) + let bizs =[] as fcBizType[] + data.forEach((fclt) =>{ + bizs = [ + ...bizs, + ...fclt.fcBizs + ] + }) + + + await pbnstRuseFcltUpdate(data) + console.log('bizs ', bizs) + + await pbnstRuseBizUpdate(bizs) + + console.log(' data ', data) + } + + useEffect(() => { if(code.sggCd.length){ if(searchFclts){ @@ -156,7 +182,7 @@ export default function PublicReuseFaciltyInsert() { 차수별정보 - diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index b02918872..3f6da6dec 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -91,6 +91,18 @@ const chBuCd = [ ] + +const dmdUszCd = [ + { val: "조경용수", text: "조경용수" }, + { val: "청소화장실용수", text: "청소화장실용수" }, + { val: "농업용수", text: "농업용수" }, + { val: "공업용수", text: "공업용수" }, + { val: "친수용수", text: "친수용수" }, + { val: "기타", text: "기타" }, + +] + + const pplQulity = [ { val: "도복장강관", text: "도복장강관" }, { val: "PE관", text: "PE관" }, @@ -136,6 +148,7 @@ export type comCodeState = { yn: SelectDataType[]; pplQulity: SelectDataType[]; pplLenght: SelectDataType[]; + dmdUszCd:SelectDataType[] buildingType: { RST:string, RNB:string, @@ -277,6 +290,7 @@ export const comCodeStateExport: comCodeState = { pplQulity:pplQulity, pplLenght:pplLenght, yn: yn, + dmdUszCd:dmdUszCd, buildingType:buildingType, }, }; diff --git a/apps/wr/app/store/common/searchCode/index.ts b/apps/wr/app/store/common/searchCode/index.ts index d87e0836c..c1b46a901 100644 --- a/apps/wr/app/store/common/searchCode/index.ts +++ b/apps/wr/app/store/common/searchCode/index.ts @@ -1,13 +1,14 @@ import { fetchType, getFetch, postFectch } from "@/components/lib/api"; import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type"; -import type { DemandCompType } from "./type"; +import type { DemandCompType } from "@common/business_components/ui"; export type comFcltState = { searchFclts: pubHasuType; demandCompList: DemandCompType[]; }; export type comFcltActions = { getSwtrmtFcltNm: (searchNm: string) => void; - getDemandCompList :(searchNm: string) => void + getDemandCompList :(searchNm: string,cnt:number) => void + regDemandCompany:(data:DemandCompType ) => void }; export const searchActions: (set: any) => comFcltActions = (set: any) => { @@ -30,15 +31,22 @@ export const searchActions: (set: any) => comFcltActions = (set: any) => { searchFclts: fcltNmCd, })); }, - getDemandCompList: async (searchNm: string) => { + getDemandCompList: async (searchNm: string ,cnt:number) => { const coList = await getFetch( fetchType.WR, - `reuseFc/request/${searchNm}/{3}` + `/reuseFc/request/${searchNm}/${cnt}` ); return set((state: comFcltState) => ({ ...state, demandCompList: coList, })); - }, + },regDemandCompany: async (data:DemandCompType)=>{ + + try{ + const response = await postFectch('/reuseFc/request',data,fetchType.WR ) + }catch(err){ + console.log(err) + } + } }; }; diff --git a/apps/wr/app/store/common/searchCode/type.tsx b/apps/wr/app/store/common/searchCode/type.tsx index a8cfb2e69..e69de29bb 100644 --- a/apps/wr/app/store/common/searchCode/type.tsx +++ b/apps/wr/app/store/common/searchCode/type.tsx @@ -1,13 +0,0 @@ - -export type DemandCompType = { - dmdInfoPk : string | ''; - bzmnNo : string | ''; - dmdCoNm : string | ''; - daddr : string | ''; - telno : string | ''; - rgtr : string | ''; - useUsgCd : string | ''; - ctpvCd : string | ''; - sggCd : string | ''; - - } \ No newline at end of file diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index 73bdf9665..22980aa16 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -5,6 +5,7 @@ import { fetchType, getFetch, postFectch, + putFectch, } from "@/components/lib/api"; import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList"; import { @@ -66,9 +67,9 @@ type pubFacActions = { pbnstMngData: (data: customPbnst[]) => void; pbnstBizData(data: fcBizType): void; getBizCycle: (pbnstObj: customPbnst) => void; - getDmdCompany: (txt: string) => void; getpbnstInsertIndex: (data: pbnstInsertIndex) => void; - searchDmdColist:(txt:string) =>void + pbnstRuseFcltUpdate: (ruseRes: customPbnst[]) => void; + pbnstRuseBizUpdate: (ruseRes: fcBizType[]) => void; }; export type pubFacType = pubFacState & pubFacActions; @@ -123,30 +124,40 @@ const initFetch = async (ruseFcltPk: string | undefined) => { return pbnstRes; }; -const writeRgtrAndMdfr = (data: customPbnst) => { - data.rgtr = TEST_UUID; - data.mdfr = TEST_UUID; - data.fcBizs = data.fcBizs.map((item) => { +export const writeRgtrAndMdfr = (data: customPbnst[]) => { + + data.forEach((pbnst) => { + pbnst.rgtr = TEST_UUID; + pbnst.mdfr = TEST_UUID; + + pbnst.fcBizs = pbnst.fcBizs?.map((item) => { item.rgtr = TEST_UUID; item.mdfr = TEST_UUID; - item.fcOrgwts = item.fcOrgwts?.map((item) => { - item.mdfr = TEST_UUID; - item.rgtr = TEST_UUID; - return item; + item.fcOrgwts = item.fcOrgwts?.map((orgwt) => { + orgwt.mdfr = TEST_UUID; + orgwt.rgtr = TEST_UUID; + return orgwt; + }); + + item.fcDemands = item.fcDemands?.map((dmd) => { + dmd.mdfr = TEST_UUID; + dmd.rgtr = TEST_UUID; + return dmd; }); - return item; }); - data.fcOpers = data.fcOpers.map((item) => { - item.rgtr = TEST_UUID; - item.mdfr = TEST_UUID; - return item; + pbnst.fcOpers = pbnst.fcOpers.map((oper) => { + oper.rgtr = TEST_UUID; + oper.mdfr = TEST_UUID; + return oper; }); - data.fcFiles = data.fcFiles.map((item) => { - item.rgtr = TEST_UUID; - item.mdfr = TEST_UUID; - return item; + pbnst.fcFiles = pbnst.fcFiles.map((file) => { + file.rgtr = TEST_UUID; + file.mdfr = TEST_UUID; + return file; }); +}); + return data; @@ -207,7 +218,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { const response = await postFectch( `/reuseFc/pubFc`, - JSON.stringify( writeRgtrAndMdfr(pbnstRes)) + JSON.stringify( writeRgtrAndMdfr([pbnstRes])) ); return set((state: pubFacState) => ({ @@ -221,7 +232,39 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { } catch (error) { console.error("Error updating pbnst:", error); } - }, + },pbnstRuseFcltUpdate : async(ruseRes:customPbnst[])=>{ + try { + + const response = await putFectch( + `/reuseFc/pubFc`, + ruseRes + ); + + } catch (error) { + console.error("Error pbnstRuseFcltUpdate:", error); + } + } ,pbnstRuseBizUpdate : async(ruseRes:fcBizType[])=>{ + try { + + console.log('ruseRes ', ruseRes) + const response = await putFectch( + `/reuseFc/pubFcBiz`, + ruseRes + ); + const pbnstRes = await hasuListFetch("11", "11"); + + return set((state: pubFacState) => ({ + ...state, + pbnst: { + ...state.pbnst, + pbnstRes: pbnstRes, + isInit: false, + }, + })); + } catch (error) { + console.error("Error pbnstRuseFcltUpdate:", error); + } + } , getBizCycle: async (pbnstObj: customPbnst) => { const pbnstBizCycle = pbnstObj.fcBizs.map((item) => { return { @@ -303,23 +346,15 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { if (bizIdx >= 0) { regData.fcBizs[bizIdx] = data; + const pbnstData = state.pbnst.pbnstMngRegData + state.pbnst.pbnstMngRegData= [...pbnstData] + } } } return state; }); }, - getDmdCompany: async (txt: string) => { - const company = await getFetch(fetchType.WR, `/reuseFc/request/${txt}/3`); - - return set((state: pubFacState) => ({ - ...state, - pbnst: { - ...state.pbnst, - isInit: false, - }, - })); - }, getpbnstInsertIndex: async (data: pbnstInsertIndex) => { return set((state: pubFacState) => { state.pbnst.pbnsUpdateIndex = data; @@ -339,24 +374,6 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { } catch (e) { console.log(e); } - },searchDmdColist:async (txt:string)=>{ - - try{ - console.log(' txt ', txt) - const coList = await getFetch(fetchType.WR, `reuseFc/request/${txt}/{3}`); - return set((state: pubFacState) => ({ - ...state, - pbnst: { - ...state.pbnst, - dmdCoList: coList, - isInit: false, - }, - })); - }catch(e){ - console.log(e) - - } - - } + }, }; }; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx index f3f695725..01aac072a 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx @@ -44,6 +44,25 @@ export type ruseFcltType = { splyExtraCpct: number; }; +export type PbnstDemandComType = { + dmdInfoPk : string | ''; + bzmnNo : string | ''; + dmdCoNm : string | ''; + daddr : string | ''; + telno : string | ''; + rgtr : string | ''; + useUsgCd : string | ''; + ctpvCd : string | ''; + sggCd : string | ''; + dmdAplyPswd: string | ''; + splyCpct: number | 0; + splyFmYn:string|'Y' + dmdInfoFk:string|'' + +} + + + export type fcBizType = z.infer; export type fcOrgwtType = z.infer; export type ppInstlType = z.infer; @@ -53,7 +72,7 @@ export type fcFileType = z.infer; const pplInstlSchema = z.object({ - ruseFcltBizFk: z.string(), + ruseFcltBizFk: z.number(), choose:z.boolean().default(false), pdmt: z.string().default(''), ppMqlt: z.string().default(""), @@ -72,7 +91,7 @@ const fcFileSchema = z.object({ const fcOperSchema = z.object({ pbnstRuseFcltOperInfoPk: z.number().nullish(), - pbnstRuseFcltFk: z.number().nullish(), + pbnstRuseFcltFk: z.string().nullish(), operMthd: z.string(), rprtvBzenty: z.string(), bgngDt: z.date().default(new Date()), @@ -121,13 +140,18 @@ export type pubHasuType = z.infer; const dmdColist = z.object({ + dmdInfoFk:z.string().default(''), dmdCoNm: z.string().default(''), daddr: z.string(), useUsgCd: z.string().default(""), splyBgngDay: z.date().default(new Date()), splyEndDay: z.date().default(new Date()), - splyCpct: z.string().default(""), - splyFmYn: z.number().default(0), + splyCpct: z.number().default(0), + splyFmYn: z.string().default('Y'), + rgtr: z.string().nullish(), + mdfr: z.string().nullish(), + pbnstRuseFcltBizPk: z.number(), + pbnstRuseFcltFk: z.string(), //telno:z.string().default('') }); diff --git a/apps/wr/components/lib/api/index.ts b/apps/wr/components/lib/api/index.ts index e853428f5..ad0ab4729 100644 --- a/apps/wr/components/lib/api/index.ts +++ b/apps/wr/components/lib/api/index.ts @@ -22,7 +22,7 @@ export const getFetch = async (type: string, url: string) => { }); if (!response.ok) { - throw new Error(`오류 발생: ${response.status}`); + console.log(`오류 발생: ${response.status}`); } const contentType = response.headers.get("content-type") ?? ""; diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index 4ef27037b..04e17867c 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -13,6 +13,7 @@ import { fcBizSchema, type customPbnst, type fcBizType, + type PbnstDemandComType, type ppInstlType, } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; @@ -31,16 +32,22 @@ import { type SelectDataType, } from "@common/business_components/ui"; import { Form, FormField } from "@common/business_components/ui/form"; -import { Button, DatePicker, Input, Label } from "@common/components"; +import { + Button, + DataTable, + DatePicker, + Input, + Label, +} from "@common/components"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useRef, useState } from "react"; import { useFieldArray, useForm } from "react-hook-form"; import MngRegFormDetail from "../mngReg/mngRegFormDetail/mngRegFormDetail"; -import { - safeDate, -} from "@/components/lib/func/commom"; +import { safeDate } from "@/components/lib/func/commom"; import SearchInputText from "@/components/ui/searchInput/searchInput"; -import type { DemandCompType } from "@/app/store/common/searchCode/type"; +import SdmInsertForm, { + type DemandCompType, +} from "@common/business_components/ui/sdmInsertForm"; export function PbnstBuseForm({ formType, @@ -53,11 +60,13 @@ export function PbnstBuseForm({ const { code, pbnst, + demandCompList, pbnstBizData, getpbnstInsertIndex, appendRuseFclt, getBizCycle, - searchDmdColist, + getDemandCompList, + regDemandCompany, } = useWrStore((state) => state); const { pbnstBizCycle, pbnstRes } = pbnst; const [bizCycle, setBizCycle] = useState("1"); @@ -66,7 +75,10 @@ export function PbnstBuseForm({ const [ppiYn, setPpiYn] = useState("Y"); const [isFcOrgwts, setIsFcOrgwts] = useState(false); const [sumCpct, setSumCpct] = useState(0); - const [searchDmdCo, setSeachDmdCo] = useState(); + const [isDmdModal, setIsDmdModal] = useState<{ + isMoal: boolean; + data: DemandCompType; + }>({ isMoal: false, data: {} as DemandCompType }); const form = useForm({ resolver: zodResolver(fcBizSchema), @@ -143,6 +155,9 @@ export function PbnstBuseForm({ // 등록할때 신규 값을 계속 가지고 있으려고 useEffect(() => { + const formData = form.watch(); + + formData.pplInstls = ref.current ? [...ref.current] : []; // ← form 내부 상태 기준으로 복사 if (formType === "reg") { if ( firstBizData && @@ -156,15 +171,16 @@ export function PbnstBuseForm({ ); form.setValue("cycl", firstBizData[0].cycl); } - const formData = form.watch(); - formData.pplInstls = ref.current ? [...ref.current] : []; // ← form 내부 상태 기준으로 복사 pbnstBizData(formData as fcBizType); - } - }, [firstBizData, form.formState, formType]); + }else if(formType === "update"){ + + console.log('formdata ', formData) + pbnstBizData(formData as fcBizType); + + + } + }, [firstBizData, form.formState, formType, pbnst.pbnstRes]); - useEffect(() => { - console.log("searchDmdCo ", searchDmdCo); - }, [searchDmdCo]); useEffect(() => { if (ppiYn === "N") { @@ -178,7 +194,7 @@ export function PbnstBuseForm({ const plusHist = () => { const regData = { - ruseFcltBizFk: ref.current?.[0]?.ruseFcltBizFk ?? "", + ruseFcltBizFk: ref.current?.[0]?.ruseFcltBizFk ?? form.getValues('pbnstRuseFcltBizPk'), choose: false, ppMqlt: "", pdmt: "", @@ -195,15 +211,16 @@ export function PbnstBuseForm({ }; const plusArray = () => { - console.log("qweqwe "); appendDemand({ dmdCoNm: "", daddr: "", useUsgCd: "", splyBgngDay: new Date(), splyEndDay: new Date(), - splyCpct: "", - splyFmYn: 0, + splyCpct: 0, + splyFmYn: "Y", + pbnstRuseFcltBizPk: form.getValues('pbnstRuseFcltBizPk'), + pbnstRuseFcltFk: form.getValues('pbnstRuseFcltFk')??'', //telno: "", }); }; @@ -401,12 +418,27 @@ export function PbnstBuseForm({ moClass="grid grid-cols-12 gap-4" sonClass="col-span-4" /> -
+

{"하수처리수 재이용수 수요처"}

+
{fcDemands.map((field, index) => ( -
-
+
+
{ - setSeachDmdCo(valList) + setValue={(val) => { + f.onChange(val); + + if (val) getDemandCompList(val, 3); + }} + setRtnData={(valList: PbnstDemandComType[]) => { + console.log('valList[0] ', index) + if ( + valList.length > 0 && + valList['0'] + ) { + form.setValue( + `fcDemands.${index}.pbnstRuseFcltBizPk`, + form.getValues('pbnstRuseFcltBizPk') + ); + form.setValue( + `fcDemands.${index}.pbnstRuseFcltFk`, + form.getValues('pbnstRuseFcltFk')??'' + + ); + form.setValue( + `fcDemands.${index}.dmdCoNm`, + valList['0'].dmdCoNm + ); + form.setValue( + `fcDemands.${index}.daddr`, + valList['0'].daddr + ); + form.setValue( + `fcDemands.${index}.useUsgCd`, + valList['0'].useUsgCd + ); + form.setValue( + `fcDemands.${index}.splyCpct`, + valList['0'].splyCpct + ); + form.setValue( + `fcDemands.${index}.splyFmYn`, + valList['0'].splyFmYn ?? "Y" + ); + + form.setValue( + `fcDemands.${index}.dmdInfoPk`, + valList['0'].dmdInfoPk ?? "Y" + ); + } + }} > )} />
-
+
f.onChange(e.target.value)} value={f.value} className={selectClass} @@ -450,24 +530,27 @@ export function PbnstBuseForm({ )} />
-
+
( - f.onChange(e.target.value)} + + f.onChange(val) + } value={f.value} - className={selectClass} /> )} />
-
+
-
+
-
+
-
+
} > + + { + setIsDmdModal({ isMoal: false, data: {} as DemandCompType }); + }} + body={ + { + getDemandCompList(searchText, pageCnt); + }} + rtnInputData={(data) => { + console.log(" rtn data ", data); + regDemandCompany(data as DemandCompType); + setIsDmdModal({ isMoal: false, data: data as DemandCompType }); + }} + bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"} + > + } + >
); diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index c809b3653..3f0776a4e 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -94,8 +94,10 @@ export function PbnstMngForm({ const plusHist = () => { + const currentTableDataFromRef = ref.current ? [...ref.current] : []; const regData = { choose: false, + pbnstRuseFcltFk:form.getValues('pbnstRuseFcltPk')??"", rgtr: "", mdfr: "", operMthd: "", @@ -103,7 +105,6 @@ export function PbnstMngForm({ bgngDt: new Date(), endDt: new Date(), }; - const currentTableDataFromRef = ref.current ? [...ref.current] : []; const newDataForRHF = [...currentTableDataFromRef, regData]; form.setValue("fcOpers", newDataForRHF, { shouldValidate: true, // 필요하다면 유효성 검사 실행 @@ -251,13 +252,21 @@ export function PbnstMngForm({ //신규 등록시 입력할때 데이터 넣기 useEffect(() => { + const formData = form.watch(); + formData.fcOpers = ref.current ? [...ref.current] : []; + formData.fcFiles = regFileList ? [...regFileList] : []; if (formType === "reg") { - const formData = form.watch(); - formData.fcOpers = ref.current ? [...ref.current] : []; - formData.fcFiles = regFileList ? [...regFileList] : []; pbnstMngData([formData] as customPbnst[]); + } else if (formType === "update"){ + const updateRes = pbnst.pbnstRes?.map((item)=>{ + if(item.pbnstRuseFcltPk === item.pbnstRuseFcltPk){ + item=formData as customPbnst + } + return item + }) + pbnstMngData(updateRes as customPbnst[]); } - }, [form.formState, regFileList, formType]); + }, [form.formState, regFileList, formType, pbnst.pbnstRes]); useEffect(() => { pbnstMngData(pbnst.pbnstMngRegData); diff --git a/apps/wr/components/ui/searchInput/searchInput.tsx b/apps/wr/components/ui/searchInput/searchInput.tsx index 3b645a467..413c3593a 100644 --- a/apps/wr/components/ui/searchInput/searchInput.tsx +++ b/apps/wr/components/ui/searchInput/searchInput.tsx @@ -1,19 +1,20 @@ import { useWrStore } from '@/app/store'; -import type { DemandCompType } from '@/app/store/common/searchCode/type'; +import type { PbnstDemandComType } from '@/app/store/ruseFcltMng/fcltReg/pbnstReg/type'; +import type { DemandCompType } from '@common/business_components/ui'; import React, { useCallback, useEffect, useRef, useState } from 'react'; type thisProps = { label: string | undefined; initValue: string | undefined; setValue : (dmdCoNm?: string) => void; - setRtnData : (rtnData: DemandCompType[]) => void; + setRtnData : (rtnData: PbnstDemandComType[]) => void; } export default function SearchInputText({label=undefined, initValue=undefined, setValue=()=>{}, setRtnData=()=>{}} :thisProps) { - const { getDemandCompList, demandCompList } = useWrStore((state) => state); + const { demandCompList } = useWrStore((state) => state); const [isOpen, setIsOpen] = useState(false); @@ -25,11 +26,10 @@ export default function SearchInputText({label=undefined, initValue=undefined, s setValue(value); if (value) { setIsOpen(true); - getDemandCompList(value); } else { setIsOpen(false); } - }, [getDemandCompList, setValue]); + }, [ setValue]); const handleSuggestionClick = useCallback((dmdCoNm: string) => { setTextValue(dmdCoNm);