mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: keep original text on ingredient parse (#1102)
* Keep Original Text on Ingredient Parse * Reorder migration and update test
This commit is contained in:
parent
5e44d1c238
commit
6f309d7a89
7 changed files with 33 additions and 2 deletions
|
@ -23,6 +23,7 @@ export interface Ingredient {
|
|||
}
|
||||
|
||||
export interface ParsedIngredient {
|
||||
input: string
|
||||
confidence: Confidence;
|
||||
ingredient: Ingredient;
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ import { CreateIngredientFood, CreateIngredientUnit, IngredientFood, IngredientU
|
|||
import RecipeIngredientEditor from "~/components/Domain/Recipe/RecipeIngredientEditor.vue";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { useFoods, useRecipe, useUnits } from "~/composables/recipes";
|
||||
import { RecipeIngredient } from "~/types/api-types/admin";
|
||||
|
||||
interface Error {
|
||||
ingredientIndex: number;
|
||||
|
@ -218,7 +219,8 @@ export default defineComponent({
|
|||
let ingredients = parsedIng.value.map((ing) => {
|
||||
return {
|
||||
...ing.ingredient,
|
||||
};
|
||||
originalText: ing.input
|
||||
} as RecipeIngredient;
|
||||
});
|
||||
|
||||
ingredients = ingredients.map((ing) => {
|
||||
|
|
|
@ -155,6 +155,7 @@ export interface RecipeIngredient {
|
|||
food?: IngredientFood | CreateIngredientFood;
|
||||
disableAmount?: boolean;
|
||||
quantity?: number;
|
||||
originalText?: string;
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface Recipe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue