diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-08-05 11:51:51 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-08-05 11:51:51 +0200 |
| commit | 582df8885a3573a728394b473b826616f8969316 (patch) | |
| tree | 9c21db03f4fbfd9956ee398e0d9194ebfa5b3234 /src/utils-common.ts | |
| parent | 46ac53e11b49a7f9cdb92c3559b05f41ce90122f (diff) | |
| download | bycs-sol-582df8885a3573a728394b473b826616f8969316.tar.gz bycs-sol-582df8885a3573a728394b473b826616f8969316.zip | |
convert a lot of js to typescript and use a single graduation DB
Diffstat (limited to 'src/utils-common.ts')
| -rw-r--r-- | src/utils-common.ts | 4 |
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 ?? ""; } |
