aboutsummaryrefslogtreecommitdiff
path: root/src/utils-common.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils-common.ts')
-rw-r--r--src/utils-common.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils-common.ts b/src/utils-common.ts
index 89a8ddd..f3ad944 100644
--- a/src/utils-common.ts
+++ b/src/utils-common.ts
@@ -13,7 +13,7 @@ export function datetimeStringNow() {
}
// TODO(muhq): Cache the retrieved URL
-export async function getUserIconUrl(userId: number) {
+export async function getUserIconUrl(userId: number): Promise<string> {
const userRes = await fetch(`https://lernplattform.bycs.de/user/profile.php?id=${userId}`)
const userDoc = new DOMParser().parseFromString(await userRes.text(), 'text/html')
const userpicture = userDoc.querySelector(".userpicture");
@@ -21,5 +21,5 @@ export async function getUserIconUrl(userId: number) {
return "";
}
- return (userpicture as HTMLImageElement).src;
+ return (userpicture as HTMLImageElement).src ?? "";
}