diff --git a/src/components/students/StudentsTable.tsx b/src/components/students/StudentsTable.tsx index 3a5e2fc..ee5b4c0 100644 --- a/src/components/students/StudentsTable.tsx +++ b/src/components/students/StudentsTable.tsx @@ -55,10 +55,10 @@ class StudentsTable extends React.Component selectedStudent !== undefined ? this.handleDeleteInternshipForStudent(selectedStudent) : {}; - const columns = this.getTableColumns(); const departmentsNameForStudent = selectedStudent !== undefined ? this.getDepartmentNameForStudent(selectedStudent) : undefined; + const columns = this.getTableColumns(); return ( void): () => void { return FirestoreRefs.getDepartmentCollectionRef() - .orderBy(nameof("updatedTimestamp"), "desc") + .orderBy(nameof("createdTimestamp"), "desc") .onSnapshot((querySnapshot) => { const departmentEntities = FirebaseModelMapper.mapDocsToObjects(querySnapshot.docs); const departments = departmentEntities.map((entity) => Department.fromEntity(entity)); diff --git a/src/services/repositories/EducationsRepository.ts b/src/services/repositories/EducationsRepository.ts index 047318a..d45ebee 100644 --- a/src/services/repositories/EducationsRepository.ts +++ b/src/services/repositories/EducationsRepository.ts @@ -10,7 +10,7 @@ export class EducationsRepository { public static subscribeToEducations(onListen: (educations: Education[]) => void): () => void { return FirestoreRefs.getEducationCollectionRef() - .orderBy(nameof("updatedTimestamp"), "desc") + .orderBy(nameof("createdTimestamp"), "desc") .onSnapshot((querySnapshot) => { const educationEntities = FirebaseModelMapper.mapDocsToObjects(querySnapshot.docs); const educations = educationEntities.map((entity) => Education.fromEntity(entity)); diff --git a/src/services/repositories/SchoolsRepository.ts b/src/services/repositories/SchoolsRepository.ts index 08b8f89..1a0aa89 100644 --- a/src/services/repositories/SchoolsRepository.ts +++ b/src/services/repositories/SchoolsRepository.ts @@ -9,7 +9,7 @@ export class SchoolsRepository { public static subscribeToSchools(onListen: (schools: School[]) => void): () => void { return FirestoreRefs.getSchoolCollectionRef() - .orderBy(nameof("updatedTimestamp"), "desc") + .orderBy(nameof("createdTimestamp"), "desc") .onSnapshot((querySnapshot) => { const schoolEntities = FirebaseModelMapper.mapDocsToObjects(querySnapshot.docs); const schools = schoolEntities.map((entity) => School.fromEntity(entity)); diff --git a/src/services/repositories/StudentsRepository.ts b/src/services/repositories/StudentsRepository.ts index f50cfe1..f784027 100644 --- a/src/services/repositories/StudentsRepository.ts +++ b/src/services/repositories/StudentsRepository.ts @@ -11,7 +11,7 @@ export class StudentsRepository { public static subscribeToStudents(onListen: (students: Student[]) => void): () => void { return FirestoreRefs.getStudentCollectionRef() - .orderBy(nameof("updatedTimestamp"), "desc") + .orderBy(nameof("createdTimestamp"), "desc") .onSnapshot((querySnapshot) => { const studentEntities = FirebaseModelMapper.mapDocsToObjects(querySnapshot.docs); const students = studentEntities.map((entity) => Student.fromEntity(entity));