Preparing search index...

    Function processTagsForValidation

    • Processes tags for validation by filtering exact database matches.

      Returns exact matches and items that need validation separately. Items needing validation include their pre-computed similar items, sorted so items WITHOUT similar matches come first (better UX: "add new" before "choose existing").

      Parameters

      • tags: TagDraft[]

        Array of tags to process

      • findSimilarTags: (name: string) => tagTableElement[]

        Function to find similar tags in database

      Returns { exactMatches: tagTableElement[]; needsValidation: TagWithSimilarity[] }

      Object with exactMatches and needsValidation arrays (with similarity info)