fix: attendance admin — add user_name to records, fix Czech diacritics in table headers

- listAttendance() now maps users.first_name + last_name to user_name
- Fixed escaped Unicode in table headers (Zaměstnanec, Příchod, Poznámka)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-23 13:41:55 +01:00
parent c817e004b7
commit 2718a7b716
2 changed files with 5 additions and 3 deletions

View File

@@ -96,15 +96,15 @@ export default function AttendanceShiftTable({ records, onEdit, onDelete }: Atte
<thead> <thead>
<tr> <tr>
<th>Datum</th> <th>Datum</th>
<th>Zam\u011Bstnanec</th> <th>Zaměstnanec</th>
<th>Typ</th> <th>Typ</th>
<th>P\u0159\u00EDchod</th> <th>Příchod</th>
<th>Pauza</th> <th>Pauza</th>
<th>Odchod</th> <th>Odchod</th>
<th>Hodiny</th> <th>Hodiny</th>
<th>Projekt</th> <th>Projekt</th>
<th>GPS</th> <th>GPS</th>
<th>Pozn\u00E1mka</th> <th>Poznámka</th>
<th>Akce</th> <th>Akce</th>
</tr> </tr>
</thead> </thead>

View File

@@ -725,8 +725,10 @@ export async function listAttendance(params: ListAttendanceParams) {
...l, ...l,
project_name: projectNameMap.get(l.project_id) || `Projekt #${l.project_id}`, project_name: projectNameMap.get(l.project_id) || `Projekt #${l.project_id}`,
})); }));
const u = rec.users;
return { return {
...rec, ...rec,
user_name: u ? `${u.first_name} ${u.last_name}`.trim() : '',
project_name: rec.project_id ? (projectNameMap.get(rec.project_id) || null) : null, project_name: rec.project_id ? (projectNameMap.get(rec.project_id) || null) : null,
project_logs: logs, project_logs: logs,
}; };