From ae9516b445332df74aa817a26e5be522e243a923 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 17 May 2024 16:23:38 -0500 Subject: [PATCH] refreshAuthorStats: return the stats --- src/stats.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stats.ts b/src/stats.ts index 74242f7a..08d4bb99 100644 --- a/src/stats.ts +++ b/src/stats.ts @@ -218,7 +218,7 @@ function getFollowDiff(event: NostrEvent, prev?: NostrEvent): AuthorStatDiff[] { } /** Refresh the author's stats in the database. */ -async function refreshAuthorStats(pubkey: string): Promise { +async function refreshAuthorStats(pubkey: string): Promise { const store = await Storages.db(); const stats = await countAuthorStats(store, pubkey); @@ -227,6 +227,8 @@ async function refreshAuthorStats(pubkey: string): Promise { .values(stats) .onConflict((oc) => oc.column('pubkey').doUpdateSet(stats)) .execute(); + + return stats; } /** Calculate author stats from the database. */