From d754b5c7d8d845adb56bb9778faacbe19d9eaffb Mon Sep 17 00:00:00 2001 From: Kurt Riddlesperger Date: Sun, 9 Feb 2020 13:41:43 -0600 Subject: [PATCH] Default initial recipe add for mealplan to use recipe's base_servings --- public/viewjs/mealplan.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index 20929f1a..36df81f2 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -783,5 +783,16 @@ Grocy.Components.RecipePicker.GetPicker().on('change', function(e) $("#recipe_servings").focus(); $("#recipe_servings").select(); }, 200); + + Grocy.Api.Get('objects/recipes/' + recipeId, + function(recipe) + { + $("#recipe_servings").val(recipe.base_servings); + }, + function(xhr) + { + console.error(xhr); + } + ); } });