feat: add product stats

This commit is contained in:
Methapon2001 2024-06-18 14:07:24 +07:00
parent a018f69f91
commit 865497bf29

View file

@ -56,6 +56,11 @@ function imageLocation(id: string) {
@Route("api/v1/product")
@Tags("Product")
export class ProductController extends Controller {
@Get("stats")
async getProductStats(@Query() productTypeId?: string) {
return await prisma.product.count({ where: { productTypeId } });
}
@Get()
@Security("keycloak")
async getProduct(