Skip to content

Commit

Permalink
populate airname on included reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Apr 4, 2024
1 parent 97c514f commit 54d897b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/OffsetPaginationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ protected function marshallReviews(array $records, $flags) {
$resource->relationships()->set($relation);
if($flags & Albums::LINKS_REVIEWS_WITH_BODY) {
$reviews = Engine::api(IReview::class)->getReviews($record["id"], 1, "", Engine::session()->isAuth("u"), 1);
$record["airname"] = $reviews[0]["airname"] ?? $reviews[0]["realname"];
$record["review"] = $reviews[0]["review"];
}
$res = Reviews::fromRecord($record);
Expand Down

0 comments on commit 54d897b

Please sign in to comment.