Make new barcode added via productpicker InplaceAddBarcodeToExistingProduct flow immediately searchable (closes #839)

This commit is contained in:
Bernd Bestel 2022-04-03 12:33:22 +02:00
parent 35ed7299af
commit 34859ada02
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -51,6 +51,11 @@ Grocy.Components.ProductPicker.InAnyFlow = function()
Grocy.Components.ProductPicker.FinishFlow = function()
{
if (GetUriParam("flow") == "InplaceAddBarcodeToExistingProduct")
{
$("#product_id option[value=\"" + Grocy.Components.ProductPicker.GetValue() + "\"]").attr("data-additional-searchdata", (i, value) => `${value || ""}${GetUriParam("barcode")},`);
}
RemoveUriParam("flow");
RemoveUriParam("barcode");
RemoveUriParam("product-name");