From 578f269a65df62e3a744c70506f0613b7abfffcf Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Fri, 20 Sep 2024 09:53:30 -0300 Subject: [PATCH] refactor: countAuthorStats() function does not return search --- src/utils/stats.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/utils/stats.ts b/src/utils/stats.ts index 4946be3a..a44f8882 100644 --- a/src/utils/stats.ts +++ b/src/utils/stats.ts @@ -270,25 +270,18 @@ export async function updateEventStats( /** Calculate author stats from the database. */ export async function countAuthorStats( { pubkey, kysely, store }: RefreshAuthorStatsOpts, -): Promise { +): Promise> { const [{ count: followers_count }, { count: notes_count }, [followList]] = await Promise.all([ store.count([{ kinds: [3], '#p': [pubkey] }]), store.count([{ kinds: [1], authors: [pubkey] }]), store.query([{ kinds: [3], authors: [pubkey], limit: 1 }]), ]); - const [{ search }] = await kysely - .selectFrom('author_stats') - .select('search') - .where('pubkey', '=', [pubkey]) - .execute(); - return { pubkey, followers_count, following_count: getTagSet(followList?.tags ?? [], 'p').size, notes_count, - search, }; }