From 52fb116f3acc9eded2b89d2cffbb81732b5b3fdd Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 8 May 2026 21:54:52 -0400 Subject: [PATCH] path method --- frontend/libs/api/src/lib/config/StorytellerApiHostStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/libs/api/src/lib/config/StorytellerApiHostStore.ts b/frontend/libs/api/src/lib/config/StorytellerApiHostStore.ts index fe62be5e65..c51cd74126 100644 --- a/frontend/libs/api/src/lib/config/StorytellerApiHostStore.ts +++ b/frontend/libs/api/src/lib/config/StorytellerApiHostStore.ts @@ -39,6 +39,12 @@ export class StorytellerApiHostStore { return instance; } + /** Convert an API path to a full URL using the configured scheme and host. */ + public pathToFullUrl(path: string): string { + const trimmedPath = path.startsWith("/") ? path.slice(1) : path; + return `${this.apiSchemeAndHost}/${trimmedPath}`; + } + /** Get the API scheme and host. */ public getApiSchemeAndHost(): string { console.debug("StorytellerApiHostStore.getApiSchemeAndHost()", this.apiSchemeAndHost, this.constructor.name);