diff --git a/pages/dashboard/v2/[id].js b/pages/dashboard/v2/[id].js index 931bd7c9..2a4a05d1 100644 --- a/pages/dashboard/v2/[id].js +++ b/pages/dashboard/v2/[id].js @@ -58,35 +58,41 @@ export async function getServerSideProps(context) { } }); - let formattedStudentDataResponse = await formattedStudentData(); + let studentInfo = await formattedStudentData(); - let timestamps = getCompletionTimestamps(formattedStudentDataResponse); + let taskCompletionDates = getCompletionTimestamps(studentInfo); - let superblockURLS = await getDashedNamesURLs( + let classCertificationURLS = await getDashedNamesURLs( certificationNumbers.fccCertifications ); - let superBlockJsons = await getSuperBlockJsons(superblockURLS); - let dashboardObjs = createDashboardObject(superBlockJsons); - let totalChallenges = getTotalChallenges(dashboardObjs); + let classCertificationDetails = await getSuperBlockJsons( + classCertificationURLS + ); + + let certificationDashboardView = createDashboardObject( + classCertificationDetails + ); + + let totalCourseTasks = getTotalChallenges(certificationDashboardView); return { props: { userSession, classroomId: context.params.id, - studentData: formattedStudentDataResponse, - totalChallenges: totalChallenges, - timestamps: timestamps + studentInfo: studentInfo, + totalCourseTasks: totalCourseTasks, + taskCompletionDates: taskCompletionDates } }; } export default function Home({ userSession, - studentData, + studentInfo, classroomId, - totalChallenges, - timestamps + totalCourseTasks, + taskCompletionDates }) { return ( @@ -106,10 +112,10 @@ export default function Home({ )}