From d06e0311c968e190059523e29c48b24bdc5f82f3 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Sun, 27 Oct 2024 15:48:04 -0300 Subject: [PATCH] refactor: if statement lexemes --- src/utils/search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/search.ts b/src/utils/search.ts index 96ed9649..80228534 100644 --- a/src/utils/search.ts +++ b/src/utils/search.ts @@ -44,13 +44,13 @@ export async function getIdsBySearch( ): Promise> { const { q, limit, offset } = opts; - const lexemes = await kysely.selectNoFrom( + const [lexeme] = await kysely.selectNoFrom( sql`phraseto_tsquery(${q})` as unknown as SelectExpression, ) .execute() as { phraseto_tsquery: 'string' }[]; // if it's just stop words, don't bother making a request to the database - if (!lexemes[0].phraseto_tsquery) { + if (!lexeme.phraseto_tsquery) { return new Set(); }