From cb7c785ef458f4ef8168146c8d5a968c0ee1eaf7 Mon Sep 17 00:00:00 2001 From: penner Date: Thu, 22 Dec 2022 00:15:59 +0000 Subject: [PATCH] endpoint slashes --- ui/src/plugins/advent22.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/plugins/advent22.ts b/ui/src/plugins/advent22.ts index 8cfad6b..e53ac30 100644 --- a/ui/src/plugins/advent22.ts +++ b/ui/src/plugins/advent22.ts @@ -27,6 +27,9 @@ export class Advent22 { if (endpoint === undefined) return this.api_baseurl; + while (endpoint.startsWith('/')) + endpoint = endpoint.substring(1); + return `${this.api_baseurl}/${endpoint}`; } @@ -92,8 +95,6 @@ export class Advent22 { on_success: (data: number) => void, ): void { this.api_get( - /**Explodiert Möglicherweise */ - // oder auch nicht endpoint, (data: number) => { on_success(data);