From a89a7e763a73b72a6c7c586132df0ba3126d19e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me>
Date: Wed, 2 Aug 2023 00:59:25 +0200
Subject: [PATCH] ExerciceRoutes => Enonce: Correct repo id from exercice one
 to enonce

---
 ExpressAPI/src/routes/ExerciceRoutes.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ExpressAPI/src/routes/ExerciceRoutes.ts b/ExpressAPI/src/routes/ExerciceRoutes.ts
index 07239d0..d2977db 100644
--- a/ExpressAPI/src/routes/ExerciceRoutes.ts
+++ b/ExpressAPI/src/routes/ExerciceRoutes.ts
@@ -136,11 +136,11 @@ class ExerciceRoutes implements RoutesManager {
     }
 
     private async getEnonce(req: ApiRequest, res: express.Response) {
-        const repoTree: Array<GitlabTreeFile> = await GitlabManager.getRepositoryTree(req.boundParams.exercice.gitlabId);
+        const repoTree: Array<GitlabTreeFile> = await GitlabManager.getRepositoryTree(req.boundParams.exercice.enonce.gitlabId);
 
         let enonceYamlFile: GitlabFile;
         let immutableFiles: Array<GitlabFile> = await Promise.all(Config.enonce.baseFiles.map(async (baseFile: string) => {
-            let file = await GitlabManager.getFile(req.boundParams.exercice.gitlabId, baseFile);
+            let file = await GitlabManager.getFile(req.boundParams.exercice.enonce.gitlabId, baseFile);
 
             if ( baseFile === Config.enonce.filename ) {
                 enonceYamlFile = file;
@@ -157,7 +157,7 @@ class ExerciceRoutes implements RoutesManager {
             if ( gitlabTreeFile.type == GitlabTreeFileType.BLOB ) {
                 for ( const immutablePath of immutablePaths ) {
                     if ( gitlabTreeFile.path.startsWith(immutablePath) ) {
-                        immutableFiles.push(await GitlabManager.getFile(req.boundParams.exercice.gitlabId, gitlabTreeFile.path));
+                        immutableFiles.push(await GitlabManager.getFile(req.boundParams.exercice.enonce.gitlabId, gitlabTreeFile.path));
                         break;
                     }
                 }
-- 
GitLab