Skip to content

Commit

Permalink
refactor: 코스 핀 업데이트 DTO 수정 #255
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Dec 2, 2024
1 parent a3bcb32 commit 0e72d76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions backend/src/course/CourseController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
import { CreateCourseRequest } from '@src/course/dto/CreateCourseRequest';
import { UpdateCourseInfoRequest } from '@src/course/dto/UpdateCourseInfoRequest';
import { CourseService } from '@src/course/CourseService';
import { UpdatePinsOfCourseRequest } from '@src/course/dto/AddPlaceToCourseRequest';
import { UpdatePinsOfCourseRequest } from '@src/course/dto/UpdatePinsOfCourseRequest';
import { CoursePermissionGuard } from '@src/course/guards/CoursePermissionGuard';
import { UpdatePinInCourseRequest } from '@src/course/dto/UpdatePinInCourseRequest';
import { UpdatePinInfoInCourseRequest } from '@src/course/dto/UpdatePinInfoInCourseRequest';
import { JwtAuthGuard } from '@src/auth/JwtAuthGuard';
import { AuthUser } from '@src/auth/decortator/AuthUser';
import { ParseOptionalNumberPipe } from '@src/common/pipe/ParseOptionalNumberPipe';
Expand Down Expand Up @@ -69,13 +69,13 @@ export class CourseController {

@Put('/:id/places/:placeId')
@UseGuards(JwtAuthGuard, CoursePermissionGuard)
async updatePinInCourse(
async updatePinInfoInCourse(
@Param('id') id: number,
@Param('placeId') placeId: number,
@Body() updatePinInCourseRequest: UpdatePinInCourseRequest,
@Body() updatePinInfoInCourseRequest: UpdatePinInfoInCourseRequest,
) {
const { comment } = updatePinInCourseRequest;
if (updatePinInCourseRequest.isEmpty()) {
const { comment } = updatePinInfoInCourseRequest;
if (updatePinInfoInCourseRequest.isEmpty()) {
throw new EmptyRequestException();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsOptional, IsString } from 'class-validator';

export class UpdatePinInCourseRequest {
export class UpdatePinInfoInCourseRequest {
@IsOptional()
@IsString()
comment?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { Type } from 'class-transformer';
import { IsNotConsecutiveDuplicatePlace } from '@src/course/pipes/IsNotConsecutiveDuplicatePlace';

export class SetPlacesOfCourseRequestItem {
export class UpdatePinsOfCourseRequestItem {
@IsNumber()
@IsNotEmpty()
placeId: number;
Expand All @@ -21,7 +21,7 @@ export class SetPlacesOfCourseRequestItem {
export class UpdatePinsOfCourseRequest {
@IsArray()
@ValidateNested({ each: true })
@Type(() => SetPlacesOfCourseRequestItem)
@Type(() => UpdatePinsOfCourseRequestItem)
@Validate(IsNotConsecutiveDuplicatePlace)
places: SetPlacesOfCourseRequestItem[];
pins: UpdatePinsOfCourseRequestItem[];
}

0 comments on commit 0e72d76

Please sign in to comment.