Preparing search index...

    Function collectMissingElementsFromErrors

    • Translates the unique i18n keys present in a recipe form's errors tree into the flat list of missing-element strings consumed by RecipeDialogsContext.showValidationErrorDialog.

      Parameters

      • errors: FieldErrors<
            {
                recipeImage: string;
                recipeTitle: string;
                recipeDescription: string;
                recipeTags?: { id?: number; name: string }[];
                recipePersons: number;
                recipeIngredients: {
                    id?: number;
                    name?: string;
                    quantity?: string;
                    unit?: string;
                    type?:
                        | cereal
                        | legumes
                        | vegetable
                        | plantProtein
                        | condiment
                        | sauce
                        | meat
                        | poultry
                        | fish
                        | seafood
                        | dairy
                        | cheese
                        | sugar
                        | spice
                        | fruit
                        | oilAndFat
                        | nutsAndSeeds
                        | sweetener
                        | bread
                        | baking
                        | topping;
                    season?: string[];
                    note?: string;
                }[];
                recipePreparation: { title: string; description: string }[];
                recipeTime: number;
                recipeNutrition?: {
                    id?: number;
                    energyKcal: number;
                    energyKj: number;
                    fat: number;
                    saturatedFat: number;
                    carbohydrates: number;
                    sugars: number;
                    fiber: number;
                    protein: number;
                    salt: number;
                    portionWeight: number;
                };
            },
        >

        The react-hook-form errors tree for the recipe form

      • t: (key: string) => string

        Translation function

      Returns string[]

      Array of translated missing-element labels, deduplicated