feat: add product stats
This commit is contained in:
parent
a018f69f91
commit
865497bf29
1 changed files with 5 additions and 0 deletions
|
|
@ -56,6 +56,11 @@ function imageLocation(id: string) {
|
||||||
@Route("api/v1/product")
|
@Route("api/v1/product")
|
||||||
@Tags("Product")
|
@Tags("Product")
|
||||||
export class ProductController extends Controller {
|
export class ProductController extends Controller {
|
||||||
|
@Get("stats")
|
||||||
|
async getProductStats(@Query() productTypeId?: string) {
|
||||||
|
return await prisma.product.count({ where: { productTypeId } });
|
||||||
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
async getProduct(
|
async getProduct(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue