From 4d41d7b1904cc461f2951a4cf8e733d7672bfc27 Mon Sep 17 00:00:00 2001 From: Chan531 Date: Tue, 26 Nov 2024 16:03:33 +0900 Subject: [PATCH] =?UTF-8?q?refactor(DocumentService):=20forEach=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tiki/server/document/service/DocumentService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/tiki/server/document/service/DocumentService.java b/src/main/java/com/tiki/server/document/service/DocumentService.java index 1ae3c7f7..9ac9196e 100644 --- a/src/main/java/com/tiki/server/document/service/DocumentService.java +++ b/src/main/java/com/tiki/server/document/service/DocumentService.java @@ -105,9 +105,7 @@ private void validateFolder(final Long folderId, final long teamId) { private void validateFileName(final Long folderId, final long teamId, final DocumentsCreateRequest request) { List documents = documentFinder.findByTeamIdAndFolderId(teamId, folderId); - for (Document document : documents) { - checkFileNameIsDuplicated(document.getFileName(), request); - } + documents.forEach(document -> checkFileNameIsDuplicated(document.getFileName(), request)); } private void checkFileNameIsDuplicated(final String fileName, final DocumentsCreateRequest request) {