retain order of pasted ingredients
This commit is contained in:
@ -969,6 +969,7 @@ export default {
|
|||||||
appendIngredients: function () {
|
appendIngredients: function () {
|
||||||
let ing_list = this.paste_ingredients.split(/\r?\n/)
|
let ing_list = this.paste_ingredients.split(/\r?\n/)
|
||||||
let step = this.recipe.steps.findIndex((x) => x.id == this.paste_step)
|
let step = this.recipe.steps.findIndex((x) => x.id == this.paste_step)
|
||||||
|
let order = 0
|
||||||
this.recipe.steps[step].ingredients_visible = true
|
this.recipe.steps[step].ingredients_visible = true
|
||||||
ing_list.forEach((ing) => {
|
ing_list.forEach((ing) => {
|
||||||
this.genericPostAPI("api_ingredient_from_string", { text: ing }).then((result) => {
|
this.genericPostAPI("api_ingredient_from_string", { text: ing }).then((result) => {
|
||||||
@ -981,8 +982,10 @@ export default {
|
|||||||
unit: unit,
|
unit: unit,
|
||||||
food: { name: result.data.food },
|
food: { name: result.data.food },
|
||||||
note: result.data.note,
|
note: result.data.note,
|
||||||
|
order: order,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
order++
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user