Skip to content

Commit

Permalink
Fix calculation of totalCount in DependenciesService#getDependents (
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 authored Apr 17, 2024
1 parent d6d651e commit 890795f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dirty-cups-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/cms-api": patch
---

Fix calculation of `totalCount` in `DependenciesService#getDependents`
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class DependenciesService {
ret.push(dependency);
}

const countResult = await this.withCount(qb).select("rootId").groupBy(["rootId", "rootEntityName"]);
const countResult = await this.withCount(qb).select("targetId").groupBy(["targetId", "targetEntityName"]);
const totalCount = countResult[0]?.count ?? 0;

return new PaginatedDependencies(ret, Number(totalCount));
Expand Down

0 comments on commit 890795f

Please sign in to comment.