bug in favorite

This commit is contained in:
2026-02-14 10:06:59 +03:30
parent a2727862bf
commit 0ebe9b10f1
2 changed files with 18 additions and 22 deletions
@@ -38,7 +38,7 @@ export class FoodController {
@ApiHeader(API_HEADER_SLUG)
@ApiBearerAuth()
@ApiOperation({ summary: 'Get a product by id' })
findPublicFoodById(@Param('id') productId: string, @UserId() userId?: string): Promise<any> {
findPublicFoodById(@Param('id') productId: string, @UserId() userId: string): Promise<any> {
const a = this.productService.findPublicById(productId, userId);
return a;
}
@@ -48,8 +48,8 @@ export class FoodController {
@ApiHeader(API_HEADER_SLUG)
@ApiBearerAuth()
@ApiOperation({ summary: 'toggle a product as favorite' })
@ApiParam({ name: 'productId', required: true })
setAsFavorute(@Param('productId') productId: string, @UserId() userId: string) {
@ApiParam({ name: 'id', required: true, description: 'Product ID' })
setAsFavorite(@Param('id') productId: string, @UserId() userId: string) {
return this.productService.toggleFavorite(userId, productId);
}