Browse Source

Fix user endpoint

pull/6021/head
Thomas Kaul 1 week ago
parent
commit
a1bb90ed61
  1. 21
      apps/api/src/app/admin/admin.service.ts

21
apps/api/src/app/admin/admin.service.ts

@ -532,12 +532,7 @@ export class AdminService {
this.countUsersWithAnalytics(), this.countUsersWithAnalytics(),
this.getUsersWithAnalytics({ this.getUsersWithAnalytics({
skip, skip,
take, take
where: {
NOT: {
analytics: null
}
}
}) })
]); ]);
@ -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({ const usersWithAnalytics = await this.prismaService.user.findMany({

Loading…
Cancel
Save