Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import java.util.List;

import org.ezcode.codetest.domain.problem.exception.ProblemException;
import org.ezcode.codetest.domain.problem.exception.TestcaseException;
import org.ezcode.codetest.domain.problem.exception.code.ProblemExceptionCode;
import org.ezcode.codetest.domain.problem.exception.code.TestcaseExceptionCode;
import org.ezcode.codetest.domain.problem.model.entity.Problem;
import org.ezcode.codetest.domain.problem.model.entity.Testcase;
import org.ezcode.codetest.domain.problem.repository.TestcaseRepository;
Expand Down Expand Up @@ -50,9 +48,8 @@ public void removeTestcase(Problem problem, Long testcaseId) {

Testcase findTestcase = testcaseRepository.findByTestcase(testcaseId);

// 테스트 케이스 문제와 요청한 값의 문제 id 일치한가 여부
if(!findTestcase.problemIdMatched(problem.getId())) {
throw new TestcaseException(TestcaseExceptionCode.TESTCASE_NOT_FOUND);
if (problem.getTestcases() != null) {
problem.getTestcases().remove(findTestcase);
}

testcaseRepository.delete(findTestcase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Testcase findByTestcase(Long testcaseId) {
@Override
public void delete(Testcase testcase) {

testcaseJpaRepository.delete(testcase);
testcaseJpaRepository.deleteById(testcase.getId());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@OpenAPIDefinition(
servers = {
@Server(
url = "https://ezcode.my", // ← 슬래시 없이 호스트만!
url = "https://api.ezcode.my", // ← 슬래시 없이 호스트만!
description = "Production server"
)
},
Expand Down