From 001edecdd38d73fd122bd37c8a04a657f8acc1c4 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 20 Jan 2022 15:54:45 +0100 Subject: [PATCH] fixed quick entry for shopping v2 --- vue/src/apps/ShoppingListView/ShoppingListView.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vue/src/apps/ShoppingListView/ShoppingListView.vue b/vue/src/apps/ShoppingListView/ShoppingListView.vue index 016479f74..da424e09e 100644 --- a/vue/src/apps/ShoppingListView/ShoppingListView.vue +++ b/vue/src/apps/ShoppingListView/ShoppingListView.vue @@ -843,9 +843,15 @@ export default { addItem: function () { if (this.entry_mode_simple) { this.genericPostAPI("api_ingredient_from_string", {text: this.new_item.ingredient}).then((result) => { + + let unit = null + if (result.data.unit !== '') { + unit = {'name': result.data.unit} + } + this.new_item = { amount: result.data.amount, - unit: {name: result.data.unit}, + unit: unit, food: {name: result.data.food}, } this.addEntry()