From 4bcec53ebe4abf75b55a002bdd9d56a8c4a46033 Mon Sep 17 00:00:00 2001 From: Anton Angelov <123360440+tongo-angelov@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:45:22 +0300 Subject: [PATCH] return user roles (#551) --- 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) {