Skip to content

Commit

Permalink
fix: missed camelCase calls in StudentTable.
Browse files Browse the repository at this point in the history
  • Loading branch information
anfbermudezme committed Sep 26, 2023
1 parent 309c0cf commit 9a0b2c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/features/Students/StudentsPage/_test_/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ const mockResponse = {
data: {
results: [
{
learner_name: 'Student 1',
learner_email: '[email protected]',
ccx_name: 'CCX 1',
learnerName: 'Student 1',
learnerEmail: '[email protected]',
ccxName: 'CCX 1',
instructors: ['Instructor 1'],
created: 'Fri, 25 Aug 2023 19:01:22 GMT',
},
{
learner_name: 'Student 2',
learner_email: '[email protected]',
ccx_name: 'CCX 2',
learnerName: 'Student 2',
learnerEmail: '[email protected]',
ccxName: 'CCX 2',
instructors: ['Instructor 2'],
created: 'Sat, 26 Aug 2023 19:01:22 GMT',
},
Expand Down
4 changes: 2 additions & 2 deletions src/features/Students/StudentsTable/columns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
6 changes: 3 additions & 3 deletions src/features/Students/StudentsTable/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand Down Expand Up @@ -62,7 +62,7 @@ const StudentsTable = ({
)}
>
<p>
Learner with email <b>{selectedRow.learner_email}</b> will be revoked from <b>{selectedRow.ccx_name}</b>
Learner with email <b>{selectedRow.learnerEmail}</b> will be revoked from <b>{selectedRow.ccxName}</b>
</p>
</AlertModal>
</IntlProvider>
Expand Down

0 comments on commit 9a0b2c7

Please sign in to comment.