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) {