mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
remove foods/units from parser if they're invalid
This commit is contained in:
parent
bf3127ed61
commit
29b121a0ac
1 changed files with 11 additions and 11 deletions
|
@ -228,19 +228,19 @@ export default defineNuxtComponent({
|
|||
let unitErrorMessage = "";
|
||||
let foodErrorMessage = "";
|
||||
|
||||
if (unitError || foodError) {
|
||||
if (unitError) {
|
||||
if (ing?.ingredient?.unit?.name) {
|
||||
const unit = ing.ingredient.unit.name || i18n.t("recipe.parser.no-unit");
|
||||
unitErrorMessage = i18n.t("recipe.parser.missing-unit", { unit }).toString();
|
||||
}
|
||||
if (unitError) {
|
||||
if (ing?.ingredient?.unit?.name) {
|
||||
const unit = ing.ingredient.unit.name || i18n.t("recipe.parser.no-unit");
|
||||
ing.ingredient.unit = undefined;
|
||||
unitErrorMessage = i18n.t("recipe.parser.missing-unit", { unit }).toString();
|
||||
}
|
||||
}
|
||||
|
||||
if (foodError) {
|
||||
if (ing?.ingredient?.food?.name) {
|
||||
const food = ing.ingredient.food.name || i18n.t("recipe.parser.no-food");
|
||||
foodErrorMessage = i18n.t("recipe.parser.missing-food", { food }).toString();
|
||||
}
|
||||
if (foodError) {
|
||||
if (ing?.ingredient?.food?.name) {
|
||||
const food = ing.ingredient.food.name || i18n.t("recipe.parser.no-food");
|
||||
ing.ingredient.food = undefined;
|
||||
foodErrorMessage = i18n.t("recipe.parser.missing-food", { food }).toString();
|
||||
}
|
||||
}
|
||||
panels.value.push(index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue