feat: resolved count fallback

This commit is contained in:
=
2025-05-25 22:35:16 +05:30
parent 982b506eb8
commit 782bf2cdc9
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ export const licenseDALFactory = (db: TDbClient) => {
.join(TableName.Users, `${TableName.OrgMembership}.userId`, `${TableName.Users}.id`)
.where(`${TableName.Users}.isGhost`, false)
.count();
return Number(doc?.[0].count);
return Number(doc?.[0]?.count ?? 0);
} catch (error) {
throw new DatabaseError({ error, name: "Count of Org Members" });
}

View File

@@ -434,7 +434,7 @@ export const projectDALFactory = (db: TDbClient) => {
}
})
.count();
return Number(doc?.[0].count);
return Number(doc?.[0]?.count ?? 0);
} catch (error) {
throw new DatabaseError({ error, name: "Count of Org Projects" });
}