fix: count by group

This commit is contained in:
Methapon Metanipat 2024-09-04 10:43:46 +07:00
parent 03707b7bd8
commit 3fb15f8344

View file

@ -81,8 +81,8 @@ function globalAllow(roles?: string[]) {
export class ServiceController extends Controller { export class ServiceController extends Controller {
@Get("stats") @Get("stats")
@Security("keycloak") @Security("keycloak")
async getServiceStats() { async getServiceStats(@Query() productGroupId?: string) {
return await prisma.service.count(); return await prisma.service.count({ where: { productGroupId } });
} }
@Get() @Get()