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); }