From 7ce429e460783c004a49c60584d3cd9cb00c3015 Mon Sep 17 00:00:00 2001 From: Amin Latifi Date: Thu, 16 May 2024 12:28:08 +0330 Subject: [PATCH] Fixed issue in computing project total attestation --- src/controllers/projectVerificationAttestation.ts | 4 +++- src/controllers/utils/modelHelper.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/projectVerificationAttestation.ts b/src/controllers/projectVerificationAttestation.ts index 0134b0a..b5ebfa1 100644 --- a/src/controllers/projectVerificationAttestation.ts +++ b/src/controllers/projectVerificationAttestation.ts @@ -98,7 +98,9 @@ export const handleProjectAttestation = async ( }); await ctx.store.upsert(projectAttestation); - ctx.log.debug(`Upserted project attestation ${projectAttestation}`); + ctx.log.debug( + `Upserted project attestation ${JSON.stringify(projectAttestation)}` + ); await updateProjectAttestationCounts(ctx, project); }; diff --git a/src/controllers/utils/modelHelper.ts b/src/controllers/utils/modelHelper.ts index 8f6d403..52c8411 100644 --- a/src/controllers/utils/modelHelper.ts +++ b/src/controllers/utils/modelHelper.ts @@ -166,7 +166,7 @@ export const getProjectStats = async ( ID, PR_TOTAL_FLAGS, PR_TOTAL_VOUCHES, - PR_TOTAL_FLAGS + PR_TOTAL_VOUCHES AS PR_TOTAL_ATTESTATIONS, + COALESCE(PR_TOTAL_FLAGS, 0) + COALESCE(PR_TOTAL_VOUCHES, 0) AS PR_TOTAL_ATTESTATIONS, ORG_FLAGS, ORG_VOUCHES, UNIQ_ORGS