This commit is contained in:
2025-12-08 15:58:30 +03:30
parent 2525b5b11a
commit 778f71fb9c
2 changed files with 4 additions and 4 deletions
@@ -55,9 +55,9 @@ export class ReviewController {
@ApiQuery({ name: 'limit', required: false, type: Number })
@ApiQuery({ name: 'orderBy', required: false, type: String })
@ApiQuery({ name: 'order', required: false, enum: ['asc', 'desc'] })
findRestuarantAllReviews(@Query() dto: FindRestuarantReviewsDto) {
findRestuarantAllReviews(@Query() dto: FindRestuarantReviewsDto, @Param('restuarantSlug') restuarantSlug: string) {
// Only show approved reviews for public endpoint
return this.reviewService.findRestuarantAllReviews({ ...dto, isApproved: true });
return this.reviewService.findRestuarantAllReviews({ ...dto, isApproved: true, restuarantSlug });
}
// @Get('public/reviews/:id')
@@ -103,7 +103,7 @@ export class ReviewController {
@ApiQuery({ name: 'orderBy', required: false, type: String })
@ApiQuery({ name: 'order', required: false, enum: ['asc', 'desc'] })
findAllAdmin(@Query() dto: FindReviewsDto, @RestId() restId: string) {
return this.reviewService.findAll({ ...dto, restId });
return this.reviewService.findAll({ ...dto, restId: restId });
}
@UseGuards(AdminAuthGuard)
@@ -52,7 +52,7 @@ export class ReviewRepository extends EntityRepository<Review> {
limit,
offset,
orderBy: { [orderBy]: order.toLowerCase() as 'asc' | 'desc' },
populate: ['food', 'user', 'order'],
// populate: ['food', 'user', 'order'],
});
const totalPages = Math.ceil(total / limit);