Support both link columns and plain foreign key columns
Deploy HiHala Dashboard / deploy (push) Successful in 6s

Production NocoDB uses DistrictId/MuseumId columns instead of
nc_epk____ link columns. Code now checks both column names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
fahed
2026-03-09 18:03:07 +03:00
parent a720b4a0aa
commit db2617f37d
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -182,13 +182,13 @@ async function fetchFromNocoDB(): Promise<MuseumRecord[]> {
museumMap[m.Id] = {
code: m.Code,
name: m.Name,
district: districtMap[m['nc_epk____Districts_id']] || 'Unknown'
district: districtMap[m.DistrictId || m['nc_epk____Districts_id']] || 'Unknown'
};
});
// Join data into flat structure
const data: MuseumRecord[] = dailyStats.map(row => {
const museum = museumMap[row['nc_epk____Museums_id']] || { code: '', name: '', district: '' };
const museum = museumMap[row.MuseumId || row['nc_epk____Museums_id']] || { code: '', name: '', district: '' };
const date = row.Date;
const year = date ? date.substring(0, 4) : '';
const month = date ? parseInt(date.substring(5, 7)) : 0;