fix: assigment summary missing _id
This commit is contained in:
parent
0635602c68
commit
62c3aaf849
|
|
@ -15,7 +15,13 @@ export const fetchStatisticData = async (
|
|||
courseId: string
|
||||
): Promise<CourseStatisticsType | null> => {
|
||||
try {
|
||||
console.log("fetching statistics for course ID: ", courseId);
|
||||
const res = await graphqlClient.query(DASHBOARD_COURSE_STATISTICS, { courseId });
|
||||
|
||||
if (res.error) {
|
||||
console.error("Error fetching statistics for course ID:", courseId, res.error);
|
||||
}
|
||||
|
||||
return res.data?.course_statistics || null;
|
||||
} catch (error) {
|
||||
console.error(`Error fetching statistics for course ID: ${courseId}`, error);
|
||||
|
|
@ -30,6 +36,11 @@ export const fetchProgressData = async (
|
|||
const res = await graphqlClient.query(DASHBOARD_COURSE_SESSION_PROGRESS, {
|
||||
courseId,
|
||||
});
|
||||
|
||||
if (res.error) {
|
||||
console.error("Error fetching progress for course ID:", courseId, res.error);
|
||||
}
|
||||
|
||||
return res.data?.course_progress || null;
|
||||
} catch (error) {
|
||||
console.error(`Error fetching progress for course ID: ${courseId}`, error);
|
||||
|
|
@ -39,6 +50,11 @@ export const fetchProgressData = async (
|
|||
export const fetchDashboardConfig = async (): Promise<DashboardConfigType[] | null> => {
|
||||
try {
|
||||
const res = await graphqlClient.query(DASHBOARD_CONFIG, {});
|
||||
|
||||
if (res.error) {
|
||||
console.error("Error fetching dashboard config:", res.error);
|
||||
}
|
||||
|
||||
return res.data?.dashboard_config || null;
|
||||
} catch (error) {
|
||||
console.error("Error fetching dashboard config:", error);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@ def create_assignment_summary(course_id, metrics) -> AssignmentStatisticsSummary
|
|||
)
|
||||
|
||||
return AssignmentStatisticsSummaryType(
|
||||
completed_count=completed_count, average_passed=average_passed_completed # noqa
|
||||
_id=course_id, # noqa
|
||||
completed_count=completed_count, # noqa
|
||||
average_passed=average_passed_completed, # noqa
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue