Skip to content

Commit f9ad312

Browse files
committed
Fix wrong routes used for gradings.
1 parent 065da1e commit f9ad312

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

client/src/hooks/fetching/Student.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ export async function setAttendanceOfStudent(
6969
}
7070

7171
export async function setPointsOfMultipleStudents(points: Map<string, IGradingDTO>): Promise<void> {
72-
// Timeout = 0 to prevent the request from timeouting.
73-
const response = await axios.put('student/grading', [...points], { timeout: 0 });
72+
// Timeout = 0 to prevent the request from running into a timeout.
73+
const response = await axios.put('grading/multiple', [...points], { timeout: 0 });
7474

7575
if (response.status !== 204) {
7676
return Promise.reject(`Wrong status code (${response.status}).`);
7777
}
7878
}
7979

8080
export async function setPointsOfStudent(studentId: string, points: IGradingDTO): Promise<void> {
81-
const response = await axios.put(`student/${studentId}/grading`, points);
81+
const response = await axios.put(`grading/student/${studentId}`, points);
8282

8383
if (response.status !== 204) {
8484
return Promise.reject(`Wrong status code (${response.status}).`);
@@ -100,7 +100,7 @@ export async function setExamPointsOfStudent(
100100
studentId: string,
101101
points: IGradingDTO
102102
): Promise<void> {
103-
const response = await axios.put(`student/${studentId}/grading`, points);
103+
const response = await axios.put(`grading/student/${studentId}`, points);
104104

105105
if (response.status !== 204) {
106106
return Promise.reject(`Wrong response code (${response.status}).`);

client/src/hooks/fetching/Team.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function setPointsOfTeam(
7878
teamId: string,
7979
points: IGradingDTO
8080
): Promise<void> {
81-
const response = await axios.put(`tutorial/${tutorialId}/team/${teamId}/grading`, points);
81+
const response = await axios.put(`grading/tutorial/${tutorialId}/team/${teamId}`, points);
8282

8383
if (response.status !== 204) {
8484
return Promise.reject(`Wrong status code (${response.status}).`);

0 commit comments

Comments
 (0)