From 7acda0028b841c76850bf93069a39849d51beb33 Mon Sep 17 00:00:00 2001 From: Ahn Jiwan Date: Tue, 5 Dec 2023 21:04:40 +0900 Subject: [PATCH] =?UTF-8?q?:bug:=20fix:=20put=20method=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#74)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/domain/family/dto/request/update-family.dto.ts | 2 +- src/domain/family/family.service.ts | 2 +- .../family_member/dto/request/update-family-member.dto.ts | 2 +- src/domain/family_member/family-member.service.ts | 2 +- .../family_schedule/dto/request/update-family-schedule.dto.ts | 2 +- src/domain/family_schedule/family-schedule.service.ts | 2 +- src/domain/post/dto/request/update-post.dto.ts | 2 +- src/domain/post/post.service.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/domain/family/dto/request/update-family.dto.ts b/src/domain/family/dto/request/update-family.dto.ts index a735af6..ccd5ccf 100644 --- a/src/domain/family/dto/request/update-family.dto.ts +++ b/src/domain/family/dto/request/update-family.dto.ts @@ -7,5 +7,5 @@ export class UpdateFamilyDto extends PartialType(CreateFamilyDto) { @ApiProperty({ example: 1, description: '가족 ID', nullable: false }) @IsNotEmpty() @IsNumber() - familyId: number; + id: number; } diff --git a/src/domain/family/family.service.ts b/src/domain/family/family.service.ts index b0f5297..161dbe4 100644 --- a/src/domain/family/family.service.ts +++ b/src/domain/family/family.service.ts @@ -71,7 +71,7 @@ export class FamilyService { //가족 정보 업데이트 async updateFamily(updateFamilyDto: UpdateFamilyDto): Promise { - const family = await this.validateFamily(updateFamilyDto.familyId); + const family = await this.validateFamily(updateFamilyDto.id); await this.familyRepository.update( { id: family.id }, { ...updateFamilyDto }, diff --git a/src/domain/family_member/dto/request/update-family-member.dto.ts b/src/domain/family_member/dto/request/update-family-member.dto.ts index 6446da1..30fd378 100644 --- a/src/domain/family_member/dto/request/update-family-member.dto.ts +++ b/src/domain/family_member/dto/request/update-family-member.dto.ts @@ -11,5 +11,5 @@ export class UpdateFamilyMemberDto extends PartialType(CreateFamilyMemberDto) { }) @IsNotEmpty() @IsNumber() - readonly familyMemberId: number; + readonly id: number; } diff --git a/src/domain/family_member/family-member.service.ts b/src/domain/family_member/family-member.service.ts index 2b486f5..37d2e41 100644 --- a/src/domain/family_member/family-member.service.ts +++ b/src/domain/family_member/family-member.service.ts @@ -55,7 +55,7 @@ export class FamilyMemberService { updateFamilyMemberDto: UpdateFamilyMemberDto, ): Promise { const familyMember = await this.validateFamilyMember( - updateFamilyMemberDto.familyMemberId, + updateFamilyMemberDto.id, ); await this.familyMemberRepository.update( { id: familyMember.id }, diff --git a/src/domain/family_schedule/dto/request/update-family-schedule.dto.ts b/src/domain/family_schedule/dto/request/update-family-schedule.dto.ts index 61e934b..a3d7e90 100644 --- a/src/domain/family_schedule/dto/request/update-family-schedule.dto.ts +++ b/src/domain/family_schedule/dto/request/update-family-schedule.dto.ts @@ -13,5 +13,5 @@ export class UpdateFamilyScheduleDto extends PartialType( }) @IsNotEmpty() @IsNumber() - readonly familyScheduleId: number; + readonly id: number; } diff --git a/src/domain/family_schedule/family-schedule.service.ts b/src/domain/family_schedule/family-schedule.service.ts index 1345d81..06edbca 100644 --- a/src/domain/family_schedule/family-schedule.service.ts +++ b/src/domain/family_schedule/family-schedule.service.ts @@ -37,7 +37,7 @@ export class FamilyScheduleService { async updateFamilySchedule(updateFamilyScheduleDto: UpdateFamilyScheduleDto) { const familySchedule = await this.validateFamilySchedule( - updateFamilyScheduleDto.familyScheduleId, + updateFamilyScheduleDto.id, ); await this.validateFamily(updateFamilyScheduleDto.familyId); await this.familyScheduleRepository.update( diff --git a/src/domain/post/dto/request/update-post.dto.ts b/src/domain/post/dto/request/update-post.dto.ts index 531c494..aa47079 100644 --- a/src/domain/post/dto/request/update-post.dto.ts +++ b/src/domain/post/dto/request/update-post.dto.ts @@ -7,5 +7,5 @@ export class UpdatePostDto extends PartialType(CreatePostDto) { @ApiProperty({ example: 1, description: '포스트의 고유 ID' }) @IsNotEmpty() @IsNumber() - postId: number; + id: number; } diff --git a/src/domain/post/post.service.ts b/src/domain/post/post.service.ts index 7a4eb78..784fa82 100644 --- a/src/domain/post/post.service.ts +++ b/src/domain/post/post.service.ts @@ -42,7 +42,7 @@ export class PostService { } async updatePost(updatePostDto: UpdatePostDto) { - const post = await this.validatePost(updatePostDto.postId); + const post = await this.validatePost(updatePostDto.id); await this.validateFamilyMember(updatePostDto.srcMemberId); await this.postRepository.update({ id: post.id }, { ...updatePostDto });