From 74f6e338f71f09c83a31a18568bea5833070e800 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 2 Jul 2025 11:50:17 -0500 Subject: [PATCH] chore: prompt edit with base helper function --- src/lib/links.ts | 2 +- src/lib/promptToEdit.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/links.ts b/src/lib/links.ts index 4e2df483a..544fbff19 100644 --- a/src/lib/links.ts +++ b/src/lib/links.ts @@ -97,7 +97,7 @@ export async function createShortlink( if (password) { body.password = password } - const response = await fetch(withAPIBaseURL('/user/shortlinks'), { + const response = await fetch(withAPIBaseURL('/user/shortlinks'), { method: 'POST', headers: { 'Content-type': 'application/json', diff --git a/src/lib/promptToEdit.tsx b/src/lib/promptToEdit.tsx index 5afe6250a..1bff58703 100644 --- a/src/lib/promptToEdit.tsx +++ b/src/lib/promptToEdit.tsx @@ -28,6 +28,7 @@ import { uuidv4 } from '@src/lib/utils' import type { File as KittyCadLibFile } from '@kittycad/lib/dist/types/src/models' import type { FileMeta } from '@src/lib/types' import type { RequestedKCLFile } from '@src/machines/systemIO/utils' +import { withAPIBaseURL } from '@src/lib/withBaseURL' type KclFileMetaMap = { [execStateFileNamesIndex: number]: Extract @@ -77,7 +78,7 @@ async function submitTextToCadRequest( }) const response = await fetch( - `${VITE_KC_API_BASE_URL}/ml/text-to-cad/multi-file/iteration`, + withAPIBaseURL('/ml/text-to-cad/multi-file/iteration'), { method: 'POST', headers: { @@ -304,7 +305,7 @@ export async function getPromptToEditResult( id: string, token?: string ): Promise { - const url = VITE_KC_API_BASE_URL + '/async/operations/' + id + const url = withAPIBaseURL(`/async/operations/${id}`) const data: Models['TextToCadMultiFileIteration_type'] | Error = await crossPlatformFetch( url, @@ -340,7 +341,7 @@ export async function doPromptEdit({ ;(window as any).process = { env: { ZOO_API_TOKEN: token, - ZOO_HOST: VITE_KC_API_BASE_URL, + ZOO_HOST: withAPIBaseURL('') }, } try {