From 91f843a515acbbe50ef20df3c24d0e64a0aacccb Mon Sep 17 00:00:00 2001 From: anfbermudezme Date: Tue, 26 Sep 2023 05:31:28 +0200 Subject: [PATCH] fix: missed camelCase calls in StudentTable. --- .../Students/StudentsPage/_test_/index.test.jsx | 12 ++++++------ src/features/Students/StudentsTable/columns.jsx | 4 ++-- src/features/Students/StudentsTable/index.jsx | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/features/Students/StudentsPage/_test_/index.test.jsx b/src/features/Students/StudentsPage/_test_/index.test.jsx index c35e4fb9..08c28e90 100644 --- a/src/features/Students/StudentsPage/_test_/index.test.jsx +++ b/src/features/Students/StudentsPage/_test_/index.test.jsx @@ -19,16 +19,16 @@ const mockResponse = { data: { results: [ { - learner_name: 'Student 1', - learner_email: 'student1@example.com', - ccx_name: 'CCX 1', + learnerName: 'Student 1', + learnerEmail: 'student1@example.com', + ccxName: 'CCX 1', instructors: ['Instructor 1'], created: 'Fri, 25 Aug 2023 19:01:22 GMT', }, { - learner_name: 'Student 2', - learner_email: 'student2@example.com', - ccx_name: 'CCX 2', + learnerName: 'Student 2', + learnerEmail: 'student2@example.com', + ccxName: 'CCX 2', instructors: ['Instructor 2'], created: 'Sat, 26 Aug 2023 19:01:22 GMT', }, diff --git a/src/features/Students/StudentsTable/columns.jsx b/src/features/Students/StudentsTable/columns.jsx index f32e95f2..940d974d 100644 --- a/src/features/Students/StudentsTable/columns.jsx +++ b/src/features/Students/StudentsTable/columns.jsx @@ -77,7 +77,7 @@ const getColumns = props => [ }, ]; -// We don't need to show ccx_id column but we need it to use handleStudentsActions. -const hideColumns = { hiddenColumns: ['ccx_id'] }; +// We don't need to show ccxId column but we need it to use handleStudentsActions. +const hideColumns = { hiddenColumns: ['ccxId'] }; export { hideColumns, getColumns }; diff --git a/src/features/Students/StudentsTable/index.jsx b/src/features/Students/StudentsTable/index.jsx index 8c2f3d24..06cc5b12 100644 --- a/src/features/Students/StudentsTable/index.jsx +++ b/src/features/Students/StudentsTable/index.jsx @@ -22,11 +22,11 @@ const StudentsTable = ({ const [selectedRow, setRow] = useState({}); const COLUMNS = useMemo(() => getColumns({ openAlertModal, setRow }), [openAlertModal]); const enrollmentData = new FormData(); - enrollmentData.append('identifiers', selectedRow.learner_email); + enrollmentData.append('identifiers', selectedRow.learnerEmail); enrollmentData.append('action', 'unenroll'); const handleStudentsActions = async () => { - await handleEnrollments(enrollmentData, selectedRow.ccx_id); + await handleEnrollments(enrollmentData, selectedRow.ccxId); fetchData(); closeAlertModal(); }; @@ -62,7 +62,7 @@ const StudentsTable = ({ )} >

- Learner with email {selectedRow.learner_email} will be revoked from {selectedRow.ccx_name} + Learner with email {selectedRow.learnerEmail} will be revoked from {selectedRow.ccxName}