Skip to content

Commit 7172943

Browse files
committed
CLAP-484 Fix: 구분 수정시 이름 중복 검증 logic 수정
1 parent 04b8841 commit 7172943

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/clap/server/application/service/label/ManageLabelService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public void editLabel(Long adminId, Long labelId, EditLabelRequest request) {
2929
Label label = loadLabelPort.findById(labelId)
3030
.orElseThrow(() -> new ApplicationException(LabelErrorCode.LABEL_NOT_FOUND));
3131

32-
loadLabelPort.existsByLabelName(request.labelName());
32+
if (loadLabelPort.existsByLabelName(request.labelName())) {
33+
throw new ApplicationException(LabelErrorCode.DUPLICATE_LABEL_NAME);
34+
};
3335

3436
label.updateLabel(request);
3537
commandLabelPort.save(label);

0 commit comments

Comments
 (0)