Track on consume for which recipe it was (closes #64 and references #64)

This commit is contained in:
Bernd Bestel
2019-03-03 18:20:06 +01:00
parent 38825c70da
commit 8020f92d6b
13 changed files with 127 additions and 7 deletions

View File

@@ -21,6 +21,11 @@
jsonData.stock_entry_id = jsonForm.specific_stock_entry;
}
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_RECIPES && Grocy.Components.RecipePicker.GetValue().toString().length > 0)
{
jsonData.recipe_id = Grocy.Components.RecipePicker.GetValue();
}
Grocy.Api.Get('stock/products/' + jsonForm.product_id,
function(productDetails)
{
@@ -38,6 +43,10 @@
$('#amount').val(1);
Grocy.Components.ProductPicker.SetValue('');
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_RECIPES)
{
Grocy.Components.RecipePicker.SetValue('');
}
Grocy.Components.ProductPicker.GetInputElement().focus();
Grocy.FrontendHelpers.ValidateForm('consume-form');
},