Skip to content

Commit

Permalink
[REFACT] 프로젝트 생성자에 대해 해당 프로젝트에 대한 매칭 요청 불가 에러코드 변경 (403 -> 400)
Browse files Browse the repository at this point in the history
  • Loading branch information
JIN-076 committed Feb 20, 2024
1 parent b66d4d0 commit 8d061ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.oeid.mogakgo.domain.project_join_req.application;

import static io.oeid.mogakgo.exception.code.ErrorCode400.INVALID_CREATOR_PROJECT_JOIN_REQUEST;
import static io.oeid.mogakgo.exception.code.ErrorCode400.INVALID_MATCHING_USER_TO_ACCEPT;
import static io.oeid.mogakgo.exception.code.ErrorCode400.INVALID_PROJECT_JOIN_REQUEST_REGION;
import static io.oeid.mogakgo.exception.code.ErrorCode400.INVALID_SENDER_TO_ACCEPT;
Expand Down Expand Up @@ -137,7 +138,7 @@ private Project validateProjectExist(Long projectId) {

private void validateProjectCreator(Project project, Long userId) {
if (project.getCreator().getId().equals(userId)) {
throw new ProjectJoinRequestException(PROJECT_JOIN_REQUEST_FORBIDDEN_OPERATION);
throw new ProjectJoinRequestException(INVALID_CREATOR_PROJECT_JOIN_REQUEST);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public enum ErrorCode400 implements ErrorCode {
PROJECT_JOIN_REQUEST_ALREADY_EXIST("E090101", "이미 매칭 요청을 전송한 프로젝트에 매칭 요청을 생성할 수 없습니다."),
INVALID_PROJECT_JOIN_REQUEST_REGION("E090102", "동네 인증한 구역에서만 프로젝트 매칭 요청을 생성할 수 있습니다."),
PROJECT_JOIN_REQUEST_SHOULD_BE_ONLY_ONE("E090103", "프로젝트 매칭 요청은 한 번에 한 개만 전송할 수 있습니다."),
INVALID_CREATOR_PROJECT_JOIN_REQUEST("E090104", "프로젝트 생성자는 해당 프로젝트에 매칭 요청을 전송할 수 없습니다."),

MATCHING_CANCEL_NOT_ALLOWED("E090101", "이미 종료되거나 취소된 매칭은 취소할 수 없습니다."),

Expand Down

0 comments on commit 8d061ee

Please sign in to comment.