diff --git a/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java b/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java index 610c919..120116c 100644 --- a/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java +++ b/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java @@ -219,6 +219,20 @@ public class FoodpalApplicationCtrl { public Recipe getSelectedRecipe() { return recipeList.getSelectionModel().getSelectedItem(); } + + /** + * Clones a recipe, when clicking on the button "clone" + */ + public void cloneRecipe() throws IOException, InterruptedException { + Recipe selected = recipeList.getSelectionModel().getSelectedItem(); + if (selected == null) { + return; + } + + server.cloneRecipe(selected.getId()); + refresh(); + + } } diff --git a/client/src/main/resources/client/scenes/FoodpalApplication.fxml b/client/src/main/resources/client/scenes/FoodpalApplication.fxml index 1962398..f9069e9 100644 --- a/client/src/main/resources/client/scenes/FoodpalApplication.fxml +++ b/client/src/main/resources/client/scenes/FoodpalApplication.fxml @@ -94,7 +94,7 @@