aboutsummaryrefslogtreecommitdiff
path: root/src/utils-mock.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils-mock.js')
-rw-r--r--src/utils-mock.js25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/utils-mock.js b/src/utils-mock.js
index 4fb2b10..99455f9 100644
--- a/src/utils-mock.js
+++ b/src/utils-mock.js
@@ -1,10 +1,13 @@
-import { fetchStudentsMock } from "./mock.ts";
+import { fetchStudentsMock, getName } from "./mock.ts";
+export { getName } from "./mock.ts";
export {
DATE_FMT,
DATETIME_FMT,
dateStringNow,
datetimeStringNow,
+ getCourseId,
getUserIconUrl,
+ getUserId,
splitmix32,
} from "./utils-common.ts";
@@ -23,22 +26,6 @@ export function getFirstAndLastname() {
return [firstname, lastname];
}
-export function getName() {
- let name = "";
-
- const params = new URLSearchParams(document.location.search);
- if (params.has("firstname")) name = params.get("firstname");
- if (params.has("lastname")) name += " " + params.get("lastname");
-
- return name.trim();
-}
-
-export function getUserId() {
- const name = getName();
-
- return fetchStudentsMock.filter((s) => s.name === name)[0].id;
-}
-
export function getActivityUrl(name) {
switch (name) {
case "Cockpit":
@@ -48,10 +35,6 @@ export function getActivityUrl(name) {
}
}
-export function getCourseId() {
- return "1337";
-}
-
export function getSesskey() {
return "sesskey";
}