Skip to content
Snippets Groups Projects
Commit a89a7e76 authored by michael.minelli's avatar michael.minelli
Browse files

ExerciceRoutes => Enonce: Correct repo id from exercice one to enonce

parent 01ca6c7d
No related branches found
No related tags found
No related merge requests found
...@@ -136,11 +136,11 @@ class ExerciceRoutes implements RoutesManager { ...@@ -136,11 +136,11 @@ class ExerciceRoutes implements RoutesManager {
} }
private async getEnonce(req: ApiRequest, res: express.Response) { 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 enonceYamlFile: GitlabFile;
let immutableFiles: Array<GitlabFile> = await Promise.all(Config.enonce.baseFiles.map(async (baseFile: string) => { 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 ) { if ( baseFile === Config.enonce.filename ) {
enonceYamlFile = file; enonceYamlFile = file;
...@@ -157,7 +157,7 @@ class ExerciceRoutes implements RoutesManager { ...@@ -157,7 +157,7 @@ class ExerciceRoutes implements RoutesManager {
if ( gitlabTreeFile.type == GitlabTreeFileType.BLOB ) { if ( gitlabTreeFile.type == GitlabTreeFileType.BLOB ) {
for ( const immutablePath of immutablePaths ) { for ( const immutablePath of immutablePaths ) {
if ( gitlabTreeFile.path.startsWith(immutablePath) ) { 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; break;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment