diff --git a/backend/src/common/SoftDeleteRepository.ts b/backend/src/common/SoftDeleteRepository.ts index 9e8a6f83..881d5dcd 100644 --- a/backend/src/common/SoftDeleteRepository.ts +++ b/backend/src/common/SoftDeleteRepository.ts @@ -5,7 +5,10 @@ import { SoftDeletableEntity, Key } from './SoftDeletableEntity.interface'; * Soft Delete 를 지원 * 기본적으로 deletedAt 이 null 인 것만 조회 */ -export abstract class SoftDeleteRepository, K extends Key> extends Repository { +export abstract class SoftDeleteRepository< + T extends SoftDeletableEntity, + K extends Key, +> extends Repository { find(options: FindManyOptions = {}) { return super.find({ ...options, @@ -60,6 +63,8 @@ export abstract class SoftDeleteRepository, K e } existById(id: K) { - return this.count({ where: { id } as FindOptionsWhere }).then((count) => count > 0); + return this.count({ where: { id } as FindOptionsWhere }).then( + (count) => count > 0, + ); } } diff --git a/backend/src/map/map.controller.ts b/backend/src/map/map.controller.ts index abb4ccdf..04d4864e 100644 --- a/backend/src/map/map.controller.ts +++ b/backend/src/map/map.controller.ts @@ -1,4 +1,13 @@ -import { Controller, Get, Post, Body, Query, Delete, Param, Patch } from '@nestjs/common'; +import { + Controller, + Get, + Post, + Body, + Query, + Delete, + Param, + Patch, +} from '@nestjs/common'; import { MapService } from './map.service'; import { CreateMapRequest } from './dto/CreateMapRequest'; import { UpdateMapInfoRequest } from './dto/UpdateMapInfoRequest'; @@ -35,13 +44,19 @@ export class MapController { } @Patch('/:id/info') - async updateMapInfo(@Param('id') id: number, @Body() updateMapForm: UpdateMapInfoRequest) { + async updateMapInfo( + @Param('id') id: number, + @Body() updateMapForm: UpdateMapInfoRequest, + ) { await this.appService.updateMapInfo(id, updateMapForm); return { id, ...updateMapForm }; } @Patch('/:id/visibility') - async updateMapVisibility(@Param('id') id: number, @Body('isPublic') isPublic: boolean) { + async updateMapVisibility( + @Param('id') id: number, + @Body('isPublic') isPublic: boolean, + ) { await this.appService.updateMapVisibility(id, isPublic); return { id, isPublic }; } diff --git a/backend/src/map/map.service.ts b/backend/src/map/map.service.ts index d7bb32fd..335afe45 100644 --- a/backend/src/map/map.service.ts +++ b/backend/src/map/map.service.ts @@ -46,7 +46,11 @@ export class MapService { where: { user: { id: userId } }, }); - const ownMaps = await this.mapRepository.findByUserId(userId, page, pageSize); + const ownMaps = await this.mapRepository.findByUserId( + userId, + page, + pageSize, + ); return { maps: await Promise.all(ownMaps.map(MapListResponse.from)), @@ -90,6 +94,7 @@ export class MapService { } private async checkExists(id: number) { - if (!(await this.mapRepository.existById(id))) throw new MapNotFoundException(id); + if (!(await this.mapRepository.existById(id))) + throw new MapNotFoundException(id); } }