From 04084ada3da43868aad2346cabc8a9118b75e8e5 Mon Sep 17 00:00:00 2001 From: miensoap Date: Tue, 12 Nov 2024 02:06:00 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=BD=94=EC=8A=A4/=EC=A7=80?= =?UTF-8?q?=EB=8F=84=EC=97=90=20=EC=9E=A5=EC=86=8C=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=A0=84=20=ED=99=95=EC=9D=B8=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95=20#86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/course/course.service.ts | 4 ++-- backend/src/map/map.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/course/course.service.ts b/backend/src/course/course.service.ts index 8cec9aa2..572a36f9 100644 --- a/backend/src/course/course.service.ts +++ b/backend/src/course/course.service.ts @@ -118,7 +118,7 @@ export class CourseService { const course = await this.courseRepository.findById(id); if (!course) throw new CourseNotFoundException(id); - await this.checkPlacesExist( + await this.validatePlacesForCourse( setPlacesOfCourseRequest.places.map((p) => p.placeId), ); @@ -131,7 +131,7 @@ export class CourseService { }; } - private async checkPlacesExist(placeIds: number[]) { + private async validatePlacesForCourse(placeIds: number[]) { const notExistsPlaceIds = await Promise.all( placeIds.map(async (placeId) => { const exists = await this.placeRepository.existById(placeId); diff --git a/backend/src/map/map.service.ts b/backend/src/map/map.service.ts index 3bfdcaf9..da7c8b01 100644 --- a/backend/src/map/map.service.ts +++ b/backend/src/map/map.service.ts @@ -112,7 +112,7 @@ export class MapService { ) { const map = await this.mapRepository.findById(id); if (!map) throw new MapNotFoundException(id); - await this.checkPlaceCanAddToMap(placeId, map); + await this.validatePlacesForMap(placeId, map); map.addPlace(placeId, color, comment); await this.mapRepository.save(map); @@ -124,7 +124,7 @@ export class MapService { }; } - private async checkPlaceCanAddToMap(placeId: number, map: Map) { + private async validatePlacesForMap(placeId: number, map: Map) { if (!(await this.placeRepository.existById(placeId))) { throw new InvalidPlaceToMapException(placeId); }