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