File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
apps/web/app/tracks/[...trackIds] Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,19 @@ const notion = new NotionAPI();
88export const dynamic = "force-dynamic" ;
99
1010// Normalize Notion record map to handle nested value.value structure
11+ // and remove blocks with no actual data (role-only entries)
1112function normalizeRecordMap ( recordMap : any ) {
1213 if ( ! recordMap ?. block ) return recordMap ;
1314 const normalizedBlock : any = { } ;
1415 for ( const [ key , block ] of Object . entries ( recordMap . block ) as any ) {
1516 if ( block ?. value ?. value ) {
17+ // Fix double-nested value.value structure
1618 normalizedBlock [ key ] = { ...block , value : block . value . value } ;
17- } else {
19+ } else if ( block ?. value ?. type ) {
20+ // Normal block with type - keep as is
1821 normalizedBlock [ key ] = block ;
1922 }
23+ // Skip blocks with no type (role-only entries like { value: { role: "none" } })
2024 }
2125 return { ...recordMap , block : normalizedBlock } ;
2226}
You can’t perform that action at this time.
0 commit comments