try get student name even better

This commit is contained in:
Primakov Alexandr Alexandrovich committed 2024-12-12 12:09:25 +03:00
1 parent 0aebb87210
commit d44a511a3d
3 files changed
+1909 -598

No files matched your search

+6 -4
View File
@@ -24,12 +24,14 @@ export const Attendance = () => {
attendance.forEach((lesson) => { attendance.forEach((lesson) => {
lesson.students.forEach((student) => { lesson.students.forEach((student) => {
const current = studentsMap.get(student.sub) || {}
studentsMap.set(student.sub, { studentsMap.set(student.sub, {
...student, ...student,
value: id: student.sub,
student.family_name && student.given_name value: current || (student.family_name && student.given_name
? `${student.family_name} ${student.given_name}` ? `${student.family_name} ${student.given_name}`
: student.name || student.email || student.preferred_username || student.family_name || student.given_name, : student.name || student.email || student.preferred_username || student.family_name || student.given_name),
}) })
}) })
}) })
@@ -60,7 +62,7 @@ export const Attendance = () => {
<th>Дата</th> <th>Дата</th>
<th>Название занятия</th> <th>Название занятия</th>
{data.students.map((student) => ( {data.students.map((student) => (
<th key={student.sub}>{student.name}</th> <th id={student.id || student.sub} key={student.sub}>{student.name || student.value}</th>
))} ))}
</tr> </tr>
</thead> </thead>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff