Feature/Include user role in admin endpoint (#3107)
* Include user role in admin endpoint
This commit is contained in:
parent
c641c28b12
commit
77358eed65
@ -440,13 +440,14 @@ export class AdminService {
|
|||||||
},
|
},
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
id: true,
|
id: true,
|
||||||
|
role: true,
|
||||||
Subscription: true
|
Subscription: true
|
||||||
},
|
},
|
||||||
take: 30
|
take: 30
|
||||||
});
|
});
|
||||||
|
|
||||||
return usersWithAnalytics.map(
|
return usersWithAnalytics.map(
|
||||||
({ _count, Analytics, createdAt, id, Subscription }) => {
|
({ _count, Analytics, createdAt, id, role, Subscription }) => {
|
||||||
const daysSinceRegistration =
|
const daysSinceRegistration =
|
||||||
differenceInDays(new Date(), createdAt) + 1;
|
differenceInDays(new Date(), createdAt) + 1;
|
||||||
const engagement = Analytics
|
const engagement = Analytics
|
||||||
@ -466,6 +467,7 @@ export class AdminService {
|
|||||||
createdAt,
|
createdAt,
|
||||||
engagement,
|
engagement,
|
||||||
id,
|
id,
|
||||||
|
role,
|
||||||
subscription,
|
subscription,
|
||||||
accountCount: _count.Account || 0,
|
accountCount: _count.Account || 0,
|
||||||
country: Analytics?.country,
|
country: Analytics?.country,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { Role } from '@prisma/client';
|
||||||
|
|
||||||
import { UniqueAsset } from './unique-asset.interface';
|
import { UniqueAsset } from './unique-asset.interface';
|
||||||
|
|
||||||
export interface AdminData {
|
export interface AdminData {
|
||||||
@ -16,6 +18,7 @@ export interface AdminData {
|
|||||||
engagement: number;
|
engagement: number;
|
||||||
id: string;
|
id: string;
|
||||||
lastActivity: Date;
|
lastActivity: Date;
|
||||||
|
role: Role;
|
||||||
transactionCount: number;
|
transactionCount: number;
|
||||||
}[];
|
}[];
|
||||||
version: string;
|
version: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user