From 71729439032901cfd526871e9a3811d1d0c50a1a Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 19 Feb 2025 17:15:18 +0900 Subject: [PATCH] =?UTF-8?q?CLAP-484=20Fix:=20=EA=B5=AC=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=8B=9C=20=EC=9D=B4=EB=A6=84=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EA=B2=80=EC=A6=9D=20logic=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/application/service/label/ManageLabelService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/clap/server/application/service/label/ManageLabelService.java b/src/main/java/clap/server/application/service/label/ManageLabelService.java index 91298d8e..47b1e765 100644 --- a/src/main/java/clap/server/application/service/label/ManageLabelService.java +++ b/src/main/java/clap/server/application/service/label/ManageLabelService.java @@ -29,7 +29,9 @@ public void editLabel(Long adminId, Long labelId, EditLabelRequest request) { Label label = loadLabelPort.findById(labelId) .orElseThrow(() -> new ApplicationException(LabelErrorCode.LABEL_NOT_FOUND)); - loadLabelPort.existsByLabelName(request.labelName()); + if (loadLabelPort.existsByLabelName(request.labelName())) { + throw new ApplicationException(LabelErrorCode.DUPLICATE_LABEL_NAME); + }; label.updateLabel(request); commandLabelPort.save(label);