fix: correct photo data structure access in model page
Photos are returned from backend as { directus_files_id: fileObject }
but frontend was trying to access p.id directly. Updated to use
p.directus_files_id.id to properly display model photos.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -22,9 +22,9 @@ const { data } = $props();
|
||||
|
||||
let images = $derived(
|
||||
data.model.photos.map((p) => ({
|
||||
...p,
|
||||
url: getAssetUrl(p.id),
|
||||
thumbnail: getAssetUrl(p.id, "thumbnail"),
|
||||
...p.directus_files_id,
|
||||
url: getAssetUrl(p.directus_files_id.id),
|
||||
thumbnail: getAssetUrl(p.directus_files_id.id, "thumbnail"),
|
||||
})),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user