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 {
@Get("stats")
@Security("keycloak")
async getServiceStats() {
return await prisma.service.count();
async getServiceStats(@Query() productGroupId?: string) {
return await prisma.service.count({ where: { productGroupId } });
}
@Get()