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);