diff --git a/.env.development b/.env.development index f18f7ad9..4dd7f8c2 100644 --- a/.env.development +++ b/.env.development @@ -20,3 +20,4 @@ ACCOUNT_PROFILE_URL='http://localhost:1995/u' MFE_CONFIG_API_URL='http://localhost:18000/api/mfe_config/v1' INSTITUTION_PORTAL_PATH='' COURSE_OPERATIONS_API_V2_BASE_URL='http://localhost:18000/pearson_course_operation/api/v2' +COURSE_OPERATIONS_API_METRICS_BASE_URL='http://localhost:18000/pearson_course_operation/api/metrics' diff --git a/src/features/Students/StudentsMetrics/index.jsx b/src/features/Students/StudentsMetrics/index.jsx index a87cb6ed..93ad44ab 100644 --- a/src/features/Students/StudentsMetrics/index.jsx +++ b/src/features/Students/StudentsMetrics/index.jsx @@ -8,17 +8,17 @@ import 'features/Students/StudentsMetrics/index.scss'; const StudentsMetrics = () => { const dispatch = useDispatch(); - const selectedInstitution = useSelector((state) => state.main.selectedInstitution); - const stateStudentsMetrics = useSelector((state) => state.students.studentsMetrics.data); - const stateClassesMetrics = useSelector((state) => state.students.classesMetrics.data); + const institution = useSelector((state) => state.main.selectedInstitution); + const studentsMetrics = useSelector((state) => state.students.studentsMetrics.data); + const classesMetrics = useSelector((state) => state.students.classesMetrics.data); const days = 100; // Temporal variable useEffect(() => { - if (Object.keys(selectedInstitution).length > 0) { - dispatch(fetchStudentsMetricsData(selectedInstitution.id, days)); - dispatch(fetchClassesMetricsData(selectedInstitution.id, days)); + if (Object.keys(institution).length > 0) { + dispatch(fetchStudentsMetricsData(institution.id, days)); + dispatch(fetchClassesMetricsData(institution.id, days)); } - }, [selectedInstitution, dispatch]); + }, [institution, dispatch]); return (
+ {studentsMetrics.numberOfEnrollments ? studentsMetrics.numberOfEnrollments : '-'} +
+ {classesMetrics.numberOfClassesCreated ? classesMetrics.numberOfClassesCreated : '-'} +