try get student name even better
This commit is contained in:
parent
0aebb87210
commit
b8741472a7
@ -24,12 +24,14 @@ export const Attendance = () => {
|
||||
|
||||
attendance.forEach((lesson) => {
|
||||
lesson.students.forEach((student) => {
|
||||
const current = studentsMap.get(student.sub) || {}
|
||||
|
||||
studentsMap.set(student.sub, {
|
||||
...student,
|
||||
value:
|
||||
student.family_name && student.given_name
|
||||
id: student.sub,
|
||||
value: current || (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>
|
||||
{data.students.map((student) => (
|
||||
<th key={student.sub}>{student.name}</th>
|
||||
<th id={student.id || student.sub} key={student.sub}>{student.name}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user