From 7459946ee1364968a0c62715cc5e834407e91b0b Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 17 Sep 2023 18:14:53 +0300 Subject: [PATCH] return user roles --- apps/api/src/person/person.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/api/src/person/person.service.ts b/apps/api/src/person/person.service.ts index dee1199a8..97573c9de 100644 --- a/apps/api/src/person/person.service.ts +++ b/apps/api/src/person/person.service.ts @@ -91,7 +91,14 @@ export class PersonService { } async findOne(id: string) { - return await this.prisma.person.findFirst({ where: { id } }) + return await this.prisma.person.findFirst({ + where: { id }, + include: { + organizer: { select: { id: true, _count: { select: { campaigns: true } } } }, + coordinators: { select: { id: true, _count: { select: { campaigns: true } } } }, + beneficiaries: { select: { id: true, _count: { select: { campaigns: true } } } }, + }, + }) } async findByEmail(email: string) {