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