ci-run-20250918-2021 #28

Merged
Nicholai merged 35 commits from ci-run-20250918-2021 into main 2025-10-30 08:10:55 +00:00
Showing only changes of commit d9005100aa - Show all commits

View File

@ -164,12 +164,19 @@ export async function getArtistWithPortfolio(id: string, env?: any): Promise<imp
ORDER BY order_index ASC, created_at DESC ORDER BY order_index ASC, created_at DESC
`).bind(id).all(); `).bind(id).all();
// Fetch flash items (public only) // Fetch flash items (public only) - tolerate missing table in older DBs
const flashResult = await db.prepare(` let flashRows: any[] = []
SELECT * FROM flash_items try {
WHERE artist_id = ? AND is_available = 1 const flashResult = await db.prepare(`
ORDER BY order_index ASC, created_at DESC SELECT * FROM flash_items
`).bind(id).all(); WHERE artist_id = ? AND is_available = 1
ORDER BY order_index ASC, created_at DESC
`).bind(id).all();
flashRows = flashResult.results as any[]
} catch (_err) {
// Table may not exist yet; treat as empty
flashRows = []
}
const artist = artistResult as any; const artist = artistResult as any;
@ -194,7 +201,7 @@ export async function getArtistWithPortfolio(id: string, env?: any): Promise<imp
createdAt: new Date(img.created_at) createdAt: new Date(img.created_at)
})), })),
// Attach as non-breaking field (not in Artist type but useful to callers) // Attach as non-breaking field (not in Artist type but useful to callers)
flashItems: (flashResult.results as any[]).map(row => ({ flashItems: flashRows.map(row => ({
id: row.id, id: row.id,
artistId: row.artist_id, artistId: row.artist_id,
url: row.url, url: row.url,