Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Missed camelCase calls in StudentTable. #10

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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