Expose published customer listings under /tenants/:host/user-products (list, search, details, technical-info) and document them in the website API pack. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
833 B
TypeScript
27 lines
833 B
TypeScript
import { Controller, Get, Param, Query } from '@nestjs/common';
|
|
import { ListPublicUserProductsDto } from './dto/user-product.dto';
|
|
import { UserProductsService } from './user-products.service';
|
|
|
|
@Controller('tenants/:host/user-products')
|
|
export class PublicUserProductsController {
|
|
constructor(private readonly service: UserProductsService) {}
|
|
|
|
@Get()
|
|
list(
|
|
@Param('host') host: string,
|
|
@Query() query: ListPublicUserProductsDto,
|
|
) {
|
|
return this.service.listPublic(host, query);
|
|
}
|
|
|
|
@Get(':slug/technical-info')
|
|
getTechnicalInfo(@Param('host') host: string, @Param('slug') slug: string) {
|
|
return this.service.getPublicTechnicalInfoBySlug(host, slug);
|
|
}
|
|
|
|
@Get(':slug')
|
|
getBySlug(@Param('host') host: string, @Param('slug') slug: string) {
|
|
return this.service.getPublicBySlug(host, slug);
|
|
}
|
|
}
|