From 8c40943d9c8e5d443f26ff3c235cebb2feec54ae Mon Sep 17 00:00:00 2001 From: ljpark Date: Tue, 18 Nov 2025 16:35:28 +0900 Subject: [PATCH] =?UTF-8?q?fo:=20=EA=B0=95=EC=9A=B0data=20promise.all=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/store/facilityPrecipitation/index.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/fo/app/store/facilityPrecipitation/index.tsx b/apps/fo/app/store/facilityPrecipitation/index.tsx index 39bc35220..6272ef55b 100644 --- a/apps/fo/app/store/facilityPrecipitation/index.tsx +++ b/apps/fo/app/store/facilityPrecipitation/index.tsx @@ -165,14 +165,12 @@ const fetchFacilityPrecipitationList = async (pageNo: number, pageSize: number, }); const rainDetailListRes: Record = {}; - const promises: Promise[] = []; + const results: any[] = []; for (let idx = 0; idx < fcltCdList.length; idx += 100) { - const slicedItems = fcltCdList.slice(idx, idx + 100); - // 각 fetch 호출을 Promise 배열에 담기 - promises.push(fetchFacilityRainDetailList(searchYear, slicedItems)); + const slicedItems = fcltCdList.slice(idx, idx + 100); + const result = await fetchFacilityRainDetailList(searchYear, slicedItems); + results.push(result); } - // 모든 요청을 병렬로 실행 - const results = await Promise.all(promises); //console.log(results); // 결과를 합치기 for (const res of results) {