ability to search for ts - not obvious

This commit is contained in:
lingdocs 2022-09-08 14:07:33 +04:00
parent e0508c8883
commit bebc76092f
1 changed files with 5 additions and 0 deletions

View File

@ -135,6 +135,11 @@ function fuzzyLookup<S extends T.DictionaryEntry>({ searchString, language, page
tpFilter?: (e: T.DictionaryEntry) => e is S,
}): S[] {
// TODO: Implement working with both
if (Number(searchString)) {
const entry = dictionary.findOneByTs(Number(searchString));
// @ts-ignore;
return entry ? [entry] : [] as S[];
}
return language === "Pashto"
? pashtoFuzzyLookup({ searchString, page, tpFilter })
: englishLookup({ searchString, page, tpFilter })