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 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-20 17:52:47 +00:00
parent ae511f1086
commit 8670822a59
2 changed files with 4 additions and 3 deletions

View file

@ -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';

View file

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