From 606407d4498d08c704f593a6b49d96d81e72f9f5 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Sat, 16 Nov 2024 17:05:49 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=8A=A4=ED=83=80=EB=B3=B5=EC=8B=B1=20?= =?UTF-8?q?=EC=8B=9C=EC=84=A4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/facility/facility.service.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/facility/facility.service.ts b/src/facility/facility.service.ts index 0e2e096..20ca392 100644 --- a/src/facility/facility.service.ts +++ b/src/facility/facility.service.ts @@ -39,7 +39,9 @@ export class FacilityService { const data = (await response.json()) as FacilityResponse; const items = data.response.body.items.item; - const facilities = items.map((item) => { + const facilities = []; + + for (const item of items) { if (item.city_cd === '45') { item.city_cd = '52'; if (item.local_cd.substring(0, 2) === '45') { @@ -52,7 +54,11 @@ export class FacilityService { } } - return { + if (item.brno === '2249423200') { + continue; + } + + facilities.push({ businessId: item.brno, serialNumber: item.facil_sn, owner: item.pres_nm, @@ -64,8 +70,8 @@ export class FacilityService { phone: item.res_telno || null, address: item.road_addr, detailAddress: item.faci_daddr || null, - }; - }); + }); + } await this.prisma.facility.createMany({ data: facilities, });