mirror of
https://github.com/lucasrcsantana/story-generator.git
synced 2025-12-17 05:47:52 +00:00
fix: corrige tipagem da interface StudentData e mapeamento de dados
This commit is contained in:
parent
6afb728dce
commit
b7d30fdc06
@ -10,6 +10,7 @@ interface StudentData {
|
||||
email: string;
|
||||
class_id: string;
|
||||
school_id: string;
|
||||
status: 'active' | 'inactive';
|
||||
classes: {
|
||||
name: string;
|
||||
};
|
||||
@ -43,6 +44,7 @@ export function StudentsPage() {
|
||||
name,
|
||||
email,
|
||||
class_id,
|
||||
status,
|
||||
classes (
|
||||
name
|
||||
)
|
||||
@ -50,13 +52,13 @@ export function StudentsPage() {
|
||||
|
||||
if (studentsError) throw studentsError;
|
||||
|
||||
const studentsWithCounts = studentsData.map((student: StudentData) => ({
|
||||
const studentsWithCounts = studentsData.map((student) => ({
|
||||
id: student.id,
|
||||
name: student.name,
|
||||
email: student.email,
|
||||
class_name: student.classes?.name || 'Sem turma',
|
||||
stories_count: 0,
|
||||
status: 'active' as const
|
||||
status: student.status || 'active'
|
||||
}));
|
||||
|
||||
setStudents(studentsWithCounts);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user