mirror of
https://github.com/grocy/grocy.git
synced 2025-09-30 11:25:03 +00:00
Default initial recipe add for mealplan to use recipe's base_servings (#554)
This commit is contained in:
@@ -783,5 +783,16 @@ Grocy.Components.RecipePicker.GetPicker().on('change', function(e)
|
|||||||
$("#recipe_servings").focus();
|
$("#recipe_servings").focus();
|
||||||
$("#recipe_servings").select();
|
$("#recipe_servings").select();
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
|
Grocy.Api.Get('objects/recipes/' + recipeId,
|
||||||
|
function(recipe)
|
||||||
|
{
|
||||||
|
$("#recipe_servings").val(recipe.base_servings);
|
||||||
|
},
|
||||||
|
function(xhr)
|
||||||
|
{
|
||||||
|
console.error(xhr);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user