Skip to content

Commit

Permalink
style: 코드 포맷팅
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Nov 6, 2024
1 parent fd47f15 commit 2744235
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
21 changes: 18 additions & 3 deletions backend/src/map/map.controller.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 };
}
Expand Down
9 changes: 7 additions & 2 deletions backend/src/map/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 2744235

Please sign in to comment.