mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
feat: Add Alerts for Ingredient Parsing Errors (#3795)
This commit is contained in:
parent
477899fce3
commit
5e0f8a4bf7
@ -64,6 +64,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, reactive, ref, toRefs, useContext } from "@nuxtjs/composition-api";
|
import { defineComponent, reactive, ref, toRefs, useContext } from "@nuxtjs/composition-api";
|
||||||
|
import { alert } from "~/composables/use-toast";
|
||||||
import { useUserApi } from "~/composables/api";
|
import { useUserApi } from "~/composables/api";
|
||||||
import { IngredientConfidence } from "~/lib/api/types/recipe";
|
import { IngredientConfidence } from "~/lib/api/types/recipe";
|
||||||
import { Parser } from "~/lib/api/user/recipes/recipe";
|
import { Parser } from "~/lib/api/user/recipes/recipe";
|
||||||
@ -161,6 +162,9 @@ export default defineComponent({
|
|||||||
properties[property].confidence = confidence;
|
properties[property].confidence = confidence;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
alert.error(i18n.t("events.something-went-wrong") as string);
|
||||||
|
state.results = false;
|
||||||
}
|
}
|
||||||
state.loading = false;
|
state.loading = false;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,7 @@ import { computed, defineComponent, ref, useContext, useRoute, useRouter, watch
|
|||||||
import { invoke, until } from "@vueuse/core";
|
import { invoke, until } from "@vueuse/core";
|
||||||
import draggable from "vuedraggable";
|
import draggable from "vuedraggable";
|
||||||
import RecipeIngredientEditor from "~/components/Domain/Recipe/RecipeIngredientEditor.vue";
|
import RecipeIngredientEditor from "~/components/Domain/Recipe/RecipeIngredientEditor.vue";
|
||||||
|
import { alert } from "~/composables/use-toast";
|
||||||
import { useAppInfo, useUserApi } from "~/composables/api";
|
import { useAppInfo, useUserApi } from "~/composables/api";
|
||||||
import { useRecipe } from "~/composables/recipes";
|
import { useRecipe } from "~/composables/recipes";
|
||||||
import { useFoodData, useFoodStore, useUnitData, useUnitStore } from "~/composables/store";
|
import { useFoodData, useFoodStore, useUnitData, useUnitStore } from "~/composables/store";
|
||||||
@ -239,6 +240,9 @@ export default defineComponent({
|
|||||||
errors.value = data.map((ing, index: number) => {
|
errors.value = data.map((ing, index: number) => {
|
||||||
return processIngredientError(ing, index);
|
return processIngredientError(ing, index);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
alert.error(i18n.t("events.something-went-wrong") as string);
|
||||||
|
parsedIng.value = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user