From 2c0f7f0883045335a8e3d2a8731e09335d812ea2 Mon Sep 17 00:00:00 2001 From: kriddles <54413450+kriddles@users.noreply.github.com> Date: Sun, 9 Feb 2020 13:57:25 -0600 Subject: [PATCH] Default initial recipe add for mealplan to use recipe's base_servings (#554) --- 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); + } + ); } });