From 5159beee6875fed2130c5f200148a5582736314f Mon Sep 17 00:00:00 2001 From: KKlochko Date: Sun, 29 Oct 2023 12:10:53 +0200 Subject: [PATCH] Fix the remove's command factory. --- .../cli/commands/factories/CommandFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/space/kklochko/jdbc_hospital_example/cli/commands/factories/CommandFactory.java b/src/main/java/space/kklochko/jdbc_hospital_example/cli/commands/factories/CommandFactory.java index b04bb03..3a13e55 100644 --- a/src/main/java/space/kklochko/jdbc_hospital_example/cli/commands/factories/CommandFactory.java +++ b/src/main/java/space/kklochko/jdbc_hospital_example/cli/commands/factories/CommandFactory.java @@ -45,10 +45,10 @@ public class CommandFactory { return new CommandEntity(repository, method, department); } }else { - String uuidString = commandData.arguments.get("uuid"); + String uuidString = commandData.arguments.get("id"); UUID uuid = UUID.fromString(uuidString); - Method method = repository.getClass().getMethod("delete"); + Method method = repository.getClass().getMethod("delete", UUID.class); return new CommandEntity(repository, method, uuid); } } catch (NoSuchMethodException e) {