fixed quick entry for shopping v2

This commit is contained in:
vabene1111
2022-01-20 15:54:45 +01:00
parent d27b39f7de
commit 001edecdd3

View File

@ -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()