feat: count data
This commit is contained in:
parent
cc22d761b6
commit
c7aec45592
3 changed files with 15 additions and 0 deletions
|
|
@ -37,6 +37,11 @@ type ProductGroupUpdate = {
|
||||||
@Tags("Product Group")
|
@Tags("Product Group")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
export class ProductGroup extends Controller {
|
export class ProductGroup extends Controller {
|
||||||
|
@Get()
|
||||||
|
async getProductGroupStats() {
|
||||||
|
return await prisma.productGroup.count();
|
||||||
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
async getProductGroup(@Query() query: string = "") {
|
async getProductGroup(@Query() query: string = "") {
|
||||||
const where = {
|
const where = {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,11 @@ type ProductTypeUpdate = {
|
||||||
@Tags("Product Type")
|
@Tags("Product Type")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
export class ProductType extends Controller {
|
export class ProductType extends Controller {
|
||||||
|
@Get()
|
||||||
|
async getProductTypeStats() {
|
||||||
|
return await prisma.productType.count();
|
||||||
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
async getProductType(@Query() query: string = "") {
|
async getProductType(@Query() query: string = "") {
|
||||||
const where = {
|
const where = {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,11 @@ function imageLocation(id: string) {
|
||||||
@Tags("Service")
|
@Tags("Service")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
export class ServiceController extends Controller {
|
export class ServiceController extends Controller {
|
||||||
|
@Get()
|
||||||
|
async getServiceStats() {
|
||||||
|
return await prisma.service.count();
|
||||||
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
async getService(
|
async getService(
|
||||||
@Query() query: string = "",
|
@Query() query: string = "",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue