From 237bcb92c9ce4f07669f9dc9dce775c1c889a391 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 29 Jun 2023 17:26:49 +0200 Subject: [PATCH] fixed food editor default properties unit --- vue/src/components/FoodEditor.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vue/src/components/FoodEditor.vue b/vue/src/components/FoodEditor.vue index 47e41a24e..9de2744d8 100644 --- a/vue/src/components/FoodEditor.vue +++ b/vue/src/components/FoodEditor.vue @@ -293,7 +293,9 @@ export default { if (this.item1.id !== undefined) { pf = apiClient.retrieveFood(this.item1.id).then((r) => { this.food = r.data - this.food.properties_food_unit = {name: 'g'} + if (this.food.properties_food_unit === null) { + this.food.properties_food_unit = {name: 'g'} + } }).catch(err => { StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err) })