transformFindAllOutputArraysToIds
Usage
@Injectable()
export class Service {
findAll(query: any): Promise<[Client[], number]> {
const where = query.where || {};
return this.prisma.$transaction([
this.prisma.client.findMany(query),
this.prisma.client.count({ where }),
]);
}
}[
[
{
"id": "<id>",
...
"sales": [
{ "id": "<id_1>" },
{ "id": "<id_2>" }
]
}
],
1
]Last updated