From 09c6d47a47aa107883e5705b79112d585085c2db Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 04:20:59 +0900 Subject: [PATCH] =?UTF-8?q?Delete=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/data/impl/DocumentImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java index 7ee8511f..7a303ec5 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java @@ -114,6 +114,11 @@ public class DocumentImpl implements Document { @Override public CompletableFuture deleteDocument(String documentId) { return CompletableFuture.supplyAsync(() -> { + DocumentEntity documentEntity = database.documentDao().findById(documentId); + if (documentEntity == null) { + throw new IllegalArgumentException("documentId is not found"); + } + database.documentDao().delete(documentEntity); return null; }); }