From 4011aa146ae4b808da599b8eb0cca2d36e82a52c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <git@minelli.me>
Date: Tue, 14 May 2024 22:59:21 +0200
Subject: [PATCH] Fix bug on get api url function

---
 helpers/Dojo/DojoBackendHelper.ts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/helpers/Dojo/DojoBackendHelper.ts b/helpers/Dojo/DojoBackendHelper.ts
index b201276..7475376 100644
--- a/helpers/Dojo/DojoBackendHelper.ts
+++ b/helpers/Dojo/DojoBackendHelper.ts
@@ -4,19 +4,19 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js';
 
 class DojoBackendHelper {
     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.assignmentNameOrUrl ) {
-                return url.replace('{{assignmentNameOrUrl}}', encodeURIComponent(options.assignmentNameOrUrl));
+                url = url.replace('{{assignmentNameOrUrl}}', encodeURIComponent(options.assignmentNameOrUrl));
             }
 
             if ( options.exerciseIdOrUrl ) {
-                return url.replace('{{exerciseIdOrUrl}}', encodeURIComponent(options.exerciseIdOrUrl));
+                url = url.replace('{{exerciseIdOrUrl}}', encodeURIComponent(options.exerciseIdOrUrl));
             }
 
             if ( options.gitlabProjectId ) {
-                return url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId));
+                url = url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId));
             }
         }
 
-- 
GitLab