From 4909eb17c7ffaf92fdc830e049466db5bf85f594 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me>
Date: Thu, 22 Feb 2024 11:40:43 +0100
Subject: [PATCH] AssignmentRoutes => addUpdateCorrection bug fix: Take the
 exercise last commit instead of the assignment last commit

---
 ExpressAPI/src/routes/AssignmentRoutes.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ExpressAPI/src/routes/AssignmentRoutes.ts b/ExpressAPI/src/routes/AssignmentRoutes.ts
index fc39e22..052a8bd 100644
--- a/ExpressAPI/src/routes/AssignmentRoutes.ts
+++ b/ExpressAPI/src/routes/AssignmentRoutes.ts
@@ -219,7 +219,7 @@ class AssignmentRoutes implements RoutesManager {
                 return req.session.sendResponse(res, StatusCodes.BAD_REQUEST, undefined, 'This exercise is not a correction', DojoStatusCode.EXERCISE_CORRECTION_NOT_EXIST);
             }
 
-            const lastCommit = await GitlabManager.getRepositoryLastCommit(req.boundParams.assignment!.gitlabId);
+            const lastCommit = await GitlabManager.getRepositoryLastCommit(req.boundParams.exercise!.gitlabId);
             if ( lastCommit ) {
                 await db.exercise.update({
                                              where: {
-- 
GitLab