From 8670822a598830e47f3186d269aed255215ec039 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Fri, 20 Mar 2026 17:52:47 +0000 Subject: [PATCH] Fix bare fetch() calls missing /ppt-tool basePath prefix ConfigurationInitializer: /api/can-change-keys and /api/user-config providerUtils: /api/v1/ppt/ollama/models/available Co-Authored-By: Claude Sonnet 4.6 --- frontend/app/ConfigurationInitializer.tsx | 4 ++-- frontend/utils/providerUtils.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/app/ConfigurationInitializer.tsx b/frontend/app/ConfigurationInitializer.tsx index f5d9f92..c8d50ec 100644 --- a/frontend/app/ConfigurationInitializer.tsx +++ b/frontend/app/ConfigurationInitializer.tsx @@ -32,12 +32,12 @@ export function ConfigurationInitializer({ children }: { children: React.ReactNo const fetchUserConfigState = async () => { setIsLoading(true); - const response = await fetch('/api/can-change-keys'); + const response = await apiFetch('/api/can-change-keys'); const canChangeKeys = (await response.json()).canChange; dispatch(setCanChangeKeys(canChangeKeys)); if (canChangeKeys) { - const response = await fetch('/api/user-config'); + const response = await apiFetch('/api/user-config'); const llmConfig = await response.json(); if (!llmConfig.LLM) { llmConfig.LLM = 'openai'; diff --git a/frontend/utils/providerUtils.ts b/frontend/utils/providerUtils.ts index a04d105..9be3c04 100644 --- a/frontend/utils/providerUtils.ts +++ b/frontend/utils/providerUtils.ts @@ -1,4 +1,5 @@ import { LLMConfig } from "@/types/llm_config"; +import { apiFetch } from "@/lib/apiFetch"; export interface OllamaModel { label: string; @@ -86,7 +87,7 @@ export const changeProvider = ( export const checkIfSelectedOllamaModelIsPulled = async (ollamaModel: string) => { try { - const response = await fetch('/api/v1/ppt/ollama/models/available'); + const response = await apiFetch('/api/v1/ppt/ollama/models/available'); const models = await response.json(); const pulledModels = models.map((model: any) => model.name); return pulledModels.includes(ollamaModel);