From 149727ca2152a68c60c69fd1292320a47db68126 Mon Sep 17 00:00:00 2001 From: kimday0326 Date: Thu, 6 Jun 2024 20:00:09 +0900 Subject: [PATCH] =?UTF-8?q?!hotfix:=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/khu/gitbox/domain/file/application/FileService.java | 2 +- .../domain/pullRequest/application/PullRequestService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/khu/gitbox/domain/file/application/FileService.java b/src/main/java/com/khu/gitbox/domain/file/application/FileService.java index 0f4d2e9..ced14a9 100644 --- a/src/main/java/com/khu/gitbox/domain/file/application/FileService.java +++ b/src/main/java/com/khu/gitbox/domain/file/application/FileService.java @@ -101,7 +101,7 @@ public FileGetResponse uploadNewVersionFile( .url(s3Service.uploadFile(multipartFile)) .version(parentFile.getVersion() + 1) .isLatest(false) // PR 승인 시 true로 변경되어야 함 - .writerId(1L) + .writerId(member.getId()) .workspaceId(parentFile.getWorkspaceId()) .folderId(parentFile.getFolderId()) .rootFileId(parentFile.getRootFileId()) diff --git a/src/main/java/com/khu/gitbox/domain/pullRequest/application/PullRequestService.java b/src/main/java/com/khu/gitbox/domain/pullRequest/application/PullRequestService.java index 1ba5ae1..ba4e37e 100644 --- a/src/main/java/com/khu/gitbox/domain/pullRequest/application/PullRequestService.java +++ b/src/main/java/com/khu/gitbox/domain/pullRequest/application/PullRequestService.java @@ -55,7 +55,7 @@ public void createComment(PullRequestCommentCreateRequest request, Long reviewer PullRequest pullRequest = pullRequestRepository.findById(pullRequestId) .orElseThrow(() -> new CustomException(HttpStatus.NOT_FOUND, "해당 pull-request를 찾을 수 없습니다.")); File file = fileService.findFileById(pullRequest.getFileId()); - if (file.getWriterId().equals(reviewerId)) { + if (pullRequest.getWriterId().equals(reviewerId)) { throw new CustomException(HttpStatus.BAD_REQUEST, "본인이 작성한 파일에 대한 pull-request는 승인할 수 없습니다."); } if (pullRequestCommentRepository.existsByPullRequestIdAndReviewerId(pullRequestId, reviewerId)) {