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(
|
let images = $derived(
|
||||||
data.model.photos.map((p) => ({
|
data.model.photos.map((p) => ({
|
||||||
...p,
|
...p.directus_files_id,
|
||||||
url: getAssetUrl(p.id),
|
url: getAssetUrl(p.directus_files_id.id),
|
||||||
thumbnail: getAssetUrl(p.id, "thumbnail"),
|
thumbnail: getAssetUrl(p.directus_files_id.id, "thumbnail"),
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user