diff --git a/src/main/java/idi/ntnu/no/idatt1005projektoppgave/AppController.java b/src/main/java/idi/ntnu/no/idatt1005projektoppgave/AppController.java index d1f3665a2cc3ae67853a2ffda77d1633fc889f0c..1b75adac5110cf24f6165897b4c46fdbfe3446fc 100644 --- a/src/main/java/idi/ntnu/no/idatt1005projektoppgave/AppController.java +++ b/src/main/java/idi/ntnu/no/idatt1005projektoppgave/AppController.java @@ -502,10 +502,15 @@ public class AppController implements IngredientItemCardHandler, GroupedIngredie @FXML private void onAddIngredientToIngredientItemClick(int itemId, IngredientItem.Location location) throws SQLException { - int initialSetAmount = 1; - Ingredient ingredient = database.getIngredient(itemId); - database.addIngredientItem(ingredient, initialSetAmount, -1, location); + int initialAmount; + + switch (ingredient.getUnit()) { + case milliliter, gram -> initialAmount = 10; + default -> initialAmount = 1; + } + + database.addIngredientItem(ingredient, initialAmount, -1, location); } private void setUpHomePageButtons() {