Skip to content

Commit

Permalink
fix missing data in legacy resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Oct 19, 2024
1 parent de5eaab commit 52fd83e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Legacy/V1/Resources/Models/PhotoResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function toArray($request)
$small2x = $size_variants?->getSizeVariant(SizeVariantType::SMALL2X);
$thumb = $size_variants?->getSizeVariant(SizeVariantType::THUMB);
$thumb2x = $size_variants?->getSizeVariant(SizeVariantType::THUMB2X);
$placeholder = $size_variants?->getSizeVariant(SizeVariantType::PLACEHOLDER);

return [
'id' => $this->resource->id,
Expand Down Expand Up @@ -92,6 +93,7 @@ public function toArray($request)
'small2x' => $small2x === null ? null : SizeVariantResource::make($small2x)->toArray($request),
'thumb' => $thumb === null ? null : SizeVariantResource::make($thumb)->toArray($request),
'thumb2x' => $thumb2x === null ? null : SizeVariantResource::make($thumb2x)->toArray($request),
'placeholder' => $placeholder === null ? null : SizeVariantResource::make($placeholder)->toArray($request),
],
'tags' => $this->resource->tags,
'taken_at' => $this->resource->taken_at?->toIso8601String(),
Expand Down

0 comments on commit 52fd83e

Please sign in to comment.