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

Merge branch 'v4.1'

parents 42561140 5bbb2606
No related branches found
No related tags found
No related merge requests found
...@@ -4,19 +4,19 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js'; ...@@ -4,19 +4,19 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js';
class DojoBackendHelper { class DojoBackendHelper {
public getApiUrl(route: ApiRoute, options?: Partial<{ assignmentNameOrUrl: string, exerciseIdOrUrl: string, gitlabProjectId: string }>): string { public getApiUrl(route: ApiRoute, options?: Partial<{ assignmentNameOrUrl: string, exerciseIdOrUrl: string, gitlabProjectId: string }>): string {
const url = `${ ClientsSharedConfig.apiURL }${ route }`; let url = `${ ClientsSharedConfig.apiURL }${ route }`;
if ( options ) { if ( options ) {
if ( options.assignmentNameOrUrl ) { if ( options.assignmentNameOrUrl ) {
return url.replace('{{assignmentNameOrUrl}}', encodeURIComponent(options.assignmentNameOrUrl)); url = url.replace('{{assignmentNameOrUrl}}', encodeURIComponent(options.assignmentNameOrUrl));
} }
if ( options.exerciseIdOrUrl ) { if ( options.exerciseIdOrUrl ) {
return url.replace('{{exerciseIdOrUrl}}', encodeURIComponent(options.exerciseIdOrUrl)); url = url.replace('{{exerciseIdOrUrl}}', encodeURIComponent(options.exerciseIdOrUrl));
} }
if ( options.gitlabProjectId ) { if ( options.gitlabProjectId ) {
return url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId)); url = url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId));
} }
} }
......
...@@ -18,6 +18,7 @@ interface Exercise { ...@@ -18,6 +18,7 @@ interface Exercise {
isCorrection: boolean; isCorrection: boolean;
correctionCommit: Gitlab.CommitSchema | undefined; correctionCommit: Gitlab.CommitSchema | undefined;
correctionDescription: string | undefined;
} }
......
enum ApiRoute { enum ApiRoute {
LOGIN = '/login', LOGIN = '/login',
REFRESH_TOKENS = '/refresh_tokens', REFRESH_TOKENS = '/refresh_tokens',
TEST_SESSION = '/test_session', TEST_SESSION = '/test_session',
GITLAB_CHECK_TEMPLATE_ACCESS = '/gitlab/project/{{gitlabProjectId}}/checkTemplateAccess', GITLAB_CHECK_TEMPLATE_ACCESS = '/gitlab/project/{{gitlabProjectId}}/checkTemplateAccess',
ASSIGNMENT_GET = '/assignments/{{assignmentNameOrUrl}}', ASSIGNMENT_GET = '/assignments/{{assignmentNameOrUrl}}',
ASSIGNMENT_CREATE = '/assignments', ASSIGNMENT_CREATE = '/assignments',
ASSIGNMENT_PUBLISH = '/assignments/{{assignmentNameOrUrl}}/publish', ASSIGNMENT_PUBLISH = '/assignments/{{assignmentNameOrUrl}}/publish',
ASSIGNMENT_UNPUBLISH = '/assignments/{{assignmentNameOrUrl}}/unpublish', ASSIGNMENT_UNPUBLISH = '/assignments/{{assignmentNameOrUrl}}/unpublish',
ASSIGNMENT_CORRECTION_LINK = '/assignments/{{assignmentNameOrUrl}}/corrections', ASSIGNMENT_CORRECTION_LINK = '/assignments/{{assignmentNameOrUrl}}/corrections',
ASSIGNMENT_CORRECTION_UPDATE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}', ASSIGNMENT_CORRECTION_UPDATE_DELETE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}',
EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises', EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises',
EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment', EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment',
EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results' EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results'
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment