review
This commit is contained in:
@@ -99,8 +99,11 @@ export class ReviewService {
|
||||
return this.reviewRepository.findAllPaginated({ ...restDto, restId: restaurant.id });
|
||||
}
|
||||
|
||||
async findById(id: string): Promise<Review> {
|
||||
const review = await this.reviewRepository.findOne({ id }, { populate: ['food', 'user', 'order'] });
|
||||
async findById(id: string, restaurantId: string): Promise<Review> {
|
||||
const review = await this.reviewRepository.findOne(
|
||||
{ id, order: { restaurant: { id: restaurantId } } },
|
||||
{ populate: ['food', 'user', 'order'] },
|
||||
);
|
||||
if (!review) {
|
||||
throw new NotFoundException(ReviewMessage.NOT_FOUND);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user