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

ParamsCallbackManager => Rename exerciseId to exerciseIdOrUrl because accept gitlab urls too

parent f6f6cd8b
Branches
Tags
No related merge requests found
......@@ -39,7 +39,7 @@ class ParamsCallbackManager {
staff : true
} ], 'assignment');
this.listenParam('exerciseId', backend, (ExerciseManager.get as GetFunction).bind(ExerciseManager), [ {
this.listenParam('exerciseIdOrUrl', backend, (ExerciseManager.get as GetFunction).bind(ExerciseManager), [ {
assignment: true,
members : true,
results : true
......
......@@ -72,9 +72,9 @@ class ExerciseRoutes implements RoutesManager {
registerOnBackend(backend: Express) {
backend.post('/assignments/:assignmentNameOrUrl/exercises', SecurityMiddleware.check(true, SecurityCheckType.ASSIGNMENT_IS_PUBLISHED), ParamsValidatorMiddleware.validate(this.exerciseValidator), this.createExercise.bind(this));
backend.get('/exercises/:exerciseId/assignment', SecurityMiddleware.check(false, SecurityCheckType.EXERCISE_SECRET), this.getAssignment.bind(this));
backend.get('/exercises/:exerciseIdOrUrl/assignment', SecurityMiddleware.check(false, SecurityCheckType.EXERCISE_SECRET), this.getAssignment.bind(this));
backend.post('/exercises/:exerciseId/results', SecurityMiddleware.check(false, SecurityCheckType.EXERCISE_SECRET), ParamsValidatorMiddleware.validate(this.resultValidator), this.createResult.bind(this));
backend.post('/exercises/:exerciseIdOrUrl/results', SecurityMiddleware.check(false, SecurityCheckType.EXERCISE_SECRET), ParamsValidatorMiddleware.validate(this.resultValidator), this.createResult.bind(this));
}
private getExerciseName(assignment: Assignment, members: Array<GitlabUser>, suffix: number): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment