From fd3e0ffdfd21cfdc6d5d50e11120c0f7e82e0487 Mon Sep 17 00:00:00 2001
From: Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>
Date: Fri, 10 Dec 2021 07:58:22 +0100
Subject: [PATCH] Repair wrong vue-router links.

Refs #279.
---
 resources/vue/courseware-index-app.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/resources/vue/courseware-index-app.js b/resources/vue/courseware-index-app.js
index 2ecb252c6d2..ffdae6a70c6 100755
--- a/resources/vue/courseware-index-app.js
+++ b/resources/vue/courseware-index-app.js
@@ -71,11 +71,13 @@ const mountApp = (STUDIP, createApp, element) => {
         },
     ];
 
-    const base = STUDIP.URLHelper.parameters.cid
-        ? STUDIP.URLHelper.getURL('dispatch.php/course/courseware', { cid: STUDIP.URLHelper.parameters.cid }, true)
-        : STUDIP.URLHelper.getURL('dispatch.php/contents/courseware/courseware');
+    const base = new URL(
+        STUDIP.URLHelper.parameters.cid
+            ? STUDIP.URLHelper.getURL('dispatch.php/course/courseware', { cid: STUDIP.URLHelper.parameters.cid }, true)
+            : STUDIP.URLHelper.getURL('dispatch.php/contents/courseware/courseware')
+    );
     const router = new VueRouter({
-        base,
+        base: `${base.pathname}${base.search}&`,
         routes,
     });
 
-- 
GitLab