From 582df8885a3573a728394b473b826616f8969316 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 5 Aug 2026 11:51:51 +0200 Subject: convert a lot of js to typescript and use a single graduation DB --- src/utils-common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils-common.ts') 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 { 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 ?? ""; } -- cgit v1.2.3