From ed74b2464a56a51aa16a7a3f2db1353a4f610e8f Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Sun, 15 Sep 2024 17:42:26 -0300 Subject: [PATCH] refactor: write it like a normal if statement --- src/controllers/api/search.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/search.ts b/src/controllers/api/search.ts index 30bad8e9..e220413b 100644 --- a/src/controllers/api/search.ts +++ b/src/controllers/api/search.ts @@ -96,8 +96,11 @@ async function searchEvents({ q, type, limit, account_id }: SearchQuery, signal: pubkeys.push(...(await getPubkeysBySearch(kysely, { q, limit }))); - if (!filter?.authors) filter.authors = pubkeys; - else filter.authors.push(...pubkeys); + if (!filter?.authors) { + filter.authors = pubkeys; + } else { + filter.authors.push(...pubkeys); + } filter.search = undefined; }