chore: update
This commit is contained in:
@@ -19,7 +19,7 @@ public class ReviewEntity extends BaseEntity implements ReviewInterface {
|
||||
|
||||
public UUID reviewerId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "eateryId")
|
||||
public EateryEntity eatery;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.drinkool.Role;
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.dtos.DtoMapper;
|
||||
import com.drinkool.dtos.SendReview;
|
||||
import com.drinkool.entities.EateryEntity;
|
||||
import com.drinkool.entities.ReviewEntity;
|
||||
import com.drinkool.enums.SortBy;
|
||||
import io.quarkus.panache.common.Sort;
|
||||
@@ -44,8 +45,10 @@ public class ReviewService {
|
||||
case LOWEST -> Sort.ascending("rating");
|
||||
};
|
||||
|
||||
EateryEntity eatery = EateryEntity.findById(eateryId);
|
||||
|
||||
return Response.ok()
|
||||
.entity(ReviewEntity.find("eatery.id = ?1", sort, eateryId).list())
|
||||
.entity(ReviewEntity.find("eatery = ?1", sort, eatery).list())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user