refactor: unify artwork card rendering

This commit is contained in:
2026-03-17 14:49:20 +01:00
parent 78151aabfe
commit 980a15f66e
30 changed files with 1145 additions and 656 deletions

View File

@@ -42,9 +42,11 @@ class ArtworkListResource extends JsonResource
}
$contentTypeSlug = null;
$contentTypeName = null;
$categoryPath = null;
if ($primaryCategory) {
$contentTypeSlug = optional($primaryCategory->contentType)->slug ?? null;
$contentTypeName = optional($primaryCategory->contentType)->name ?? null;
$categoryPath = $primaryCategory->full_slug_path ?? null;
}
$slugVal = $get('slug');
@@ -79,6 +81,8 @@ class ArtworkListResource extends JsonResource
'slug' => $primaryCategory->slug ?? null,
'name' => $decode($primaryCategory->name ?? null),
'content_type' => $contentTypeSlug,
'content_type_slug' => $contentTypeSlug,
'content_type_name' => $decode($contentTypeName),
'url' => $webUrl,
] : null,
'urls' => [