From ee0af566a9e8dc1e6409117c49152a7172970a89 Mon Sep 17 00:00:00 2001 From: Sumit Bisht <75713174+sumitbishti@users.noreply.github.com> Date: Thu, 25 Jan 2024 05:59:04 +0530 Subject: [PATCH] fix: correct document tab count for pending and completed (#855) completed/pending status gets incremented once if sender is one of the recipients fixes #853 --- packages/lib/server-only/document/get-stats.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/lib/server-only/document/get-stats.ts b/packages/lib/server-only/document/get-stats.ts index a446b0007..044d9a2dc 100644 --- a/packages/lib/server-only/document/get-stats.ts +++ b/packages/lib/server-only/document/get-stats.ts @@ -42,6 +42,11 @@ export const getStats = async ({ user }: GetStatsInput) => { _all: true, }, where: { + User: { + email: { + not: user.email, + }, + }, OR: [ { status: ExtendedDocumentStatus.PENDING,