fix: Tech-File html_content → content Mapping
API liefert html_content, Frontend erwartet content. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,12 @@ export default function TechFilePage() {
|
|||||||
const res = await fetch(`/api/sdk/v1/iace/projects/${projectId}/tech-file`)
|
const res = await fetch(`/api/sdk/v1/iace/projects/${projectId}/tech-file`)
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const json = await res.json()
|
const json = await res.json()
|
||||||
setSections(json.sections || json || [])
|
const raw = json.sections || json || []
|
||||||
|
// Map html_content → content for frontend compatibility
|
||||||
|
setSections(raw.map((s: Record<string, unknown>) => ({
|
||||||
|
...s,
|
||||||
|
content: s.content || s.html_content || null,
|
||||||
|
})))
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to fetch tech file sections:', err)
|
console.error('Failed to fetch tech file sections:', err)
|
||||||
|
|||||||
Reference in New Issue
Block a user