refactor: unify artwork card rendering
This commit is contained in:
@@ -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' => [
|
||||
|
||||
Reference in New Issue
Block a user