Skip to content

Commit 5573d09

Browse files
committed
Merge branch 'main' into chore/code-cleanup
2 parents 7e962cb + 0e546fe commit 5573d09

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/services/apiService.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ export class ApiService {
8686
}
8787
}
8888

89+
async fetchGradables(courseId: string, term: string): Promise<GradableResponse> {
90+
try {
91+
const url = `/api/${term}/${courseId}/gradeables`;
92+
const response = await this.client.get<GradableResponse>(url);
93+
return response.data;
94+
} catch (error: any) {
95+
console.error('Error fetching gradables:', error);
96+
throw new Error(error.response?.data?.message || 'Failed to fetch gradables.');
97+
}
98+
}
99+
89100
/**
90101
* Fetches all gradables (assignments) for a course.
91102
* @param courseId - The course ID

0 commit comments

Comments
 (0)