Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/user endpoint of admin control panel (#6021)

Thomas Kaulbe947f3710d7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4bcea795c2..be205d8773 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the country weightings in the _Financial Modeling Prep_ service
- Improved the search functionality by name in the _Financial Modeling Prep_ service
+- Resolved an issue in the user endpoint where the list was returning empty in the admin control panel’s users section
## 2.220.0 - 2025-11-29
diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts
index 0a6df76478..705085a485 100644
--- a/apps/api/src/app/admin/admin.service.ts
+++ b/apps/api/src/app/admin/admin.service.ts
@@ -532,12 +532,7 @@ export class AdminService {
this.countUsersWithAnalytics(),
this.getUsersWithAnalytics({
skip,
- take,
- where: {
- NOT: {
- analytics: null
- }
- }
+ take
})
]);
@@ -855,6 +850,20 @@ export class AdminService {
}
}
];
+
+ const noAnalyticsCondition: Prisma.UserWhereInput['NOT'] = {
+ analytics: null
+ };
+
+ if (where) {
+ if (where.NOT) {
+ where.NOT = { ...where.NOT, ...noAnalyticsCondition };
+ } else {
+ where.NOT = noAnalyticsCondition;
+ }
+ } else {
+ where = { NOT: noAnalyticsCondition };
+ }
}
const usersWithAnalytics = await this.prismaService.user.findMany({