Skip to content

Commit

Permalink
🐛 fix: put method 수정 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
synoti21 committed Dec 5, 2023
1 parent a0a7ab9 commit 7acda00
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/domain/family/dto/request/update-family.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export class UpdateFamilyDto extends PartialType(CreateFamilyDto) {
@ApiProperty({ example: 1, description: '가족 ID', nullable: false })
@IsNotEmpty()
@IsNumber()
familyId: number;
id: number;
}
2 changes: 1 addition & 1 deletion src/domain/family/family.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class FamilyService {

//가족 정보 업데이트
async updateFamily(updateFamilyDto: UpdateFamilyDto): Promise<void> {
const family = await this.validateFamily(updateFamilyDto.familyId);
const family = await this.validateFamily(updateFamilyDto.id);
await this.familyRepository.update(
{ id: family.id },
{ ...updateFamilyDto },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export class UpdateFamilyMemberDto extends PartialType(CreateFamilyMemberDto) {
})
@IsNotEmpty()
@IsNumber()
readonly familyMemberId: number;
readonly id: number;
}
2 changes: 1 addition & 1 deletion src/domain/family_member/family-member.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class FamilyMemberService {
updateFamilyMemberDto: UpdateFamilyMemberDto,
): Promise<void> {
const familyMember = await this.validateFamilyMember(
updateFamilyMemberDto.familyMemberId,
updateFamilyMemberDto.id,
);
await this.familyMemberRepository.update(
{ id: familyMember.id },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export class UpdateFamilyScheduleDto extends PartialType(
})
@IsNotEmpty()
@IsNumber()
readonly familyScheduleId: number;
readonly id: number;
}
2 changes: 1 addition & 1 deletion src/domain/family_schedule/family-schedule.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/domain/post/dto/request/update-post.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export class UpdatePostDto extends PartialType(CreatePostDto) {
@ApiProperty({ example: 1, description: '포스트의 고유 ID' })
@IsNotEmpty()
@IsNumber()
postId: number;
id: number;
}
2 changes: 1 addition & 1 deletion src/domain/post/post.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 7acda00

Please sign in to comment.