Initial commit: Mana Collection NestJS backend.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { Controller, Get, Param, Query } from '@nestjs/common';
|
||||
import { PublicService } from './public.service';
|
||||
|
||||
@Controller('public')
|
||||
export class PublicController {
|
||||
constructor(private readonly publicService: PublicService) {}
|
||||
|
||||
@Get('stores')
|
||||
listStores() {
|
||||
return this.publicService.listStores();
|
||||
}
|
||||
|
||||
@Get('products')
|
||||
listProducts(
|
||||
@Query('storeId') storeId?: string,
|
||||
@Query('storeSlug') storeSlug?: string,
|
||||
@Query('name') name?: string,
|
||||
@Query('categoryId') categoryId?: string,
|
||||
@Query('minPrice') minPrice?: number,
|
||||
@Query('maxPrice') maxPrice?: number,
|
||||
) {
|
||||
return this.publicService.listProducts({
|
||||
storeId,
|
||||
storeSlug,
|
||||
name,
|
||||
categoryId,
|
||||
minPrice,
|
||||
maxPrice,
|
||||
});
|
||||
}
|
||||
|
||||
@Get('products/:id')
|
||||
findProduct(@Param('id') id: string) {
|
||||
return this.publicService.findProduct(id);
|
||||
}
|
||||
|
||||
@Get('blogs')
|
||||
listBlogs(@Query('storeSlug') storeSlug?: string) {
|
||||
return this.publicService.listBlogs(storeSlug);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user