Fix errors with disabled feature flag STOCK_PRICE_TRACKING (#687)

fixes #685
This commit is contained in:
Mik-
2020-04-02 08:34:43 +02:00
committed by GitHub
parent 746203b82d
commit 7200f2c17f
3 changed files with 27 additions and 13 deletions

View File

@@ -14,7 +14,9 @@
jsonData.amount = jsonForm.amount;
jsonData.best_before_date = Grocy.Components.DateTimePicker.GetValue();
jsonData.purchased_date = Grocy.Components.DateTimePicker2.GetValue();
jsonData.shopping_location_id = Grocy.Components.ShoppingLocationPicker.GetValue();
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) {
jsonData.shopping_location_id = Grocy.Components.ShoppingLocationPicker.GetValue();
}
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
{
jsonData.location_id = Grocy.Components.LocationPicker.GetValue();