mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-05 09:55:17 -05: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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user