fix(picture): update API client to v1 endpoint and rename steps param

- Change API base path from /api to /api/v1 for all fetch calls
- Rename numInferenceSteps to steps in generate params to match backend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-12-07 16:11:04 +01:00
parent 6f8585e9bb
commit 833a828cfb
4 changed files with 6 additions and 6 deletions

View file

@ -38,7 +38,7 @@ export async function fetchApi<T>(
headers['Authorization'] = `Bearer ${authToken}`;
}
const response = await fetch(`${API_BASE}/api${endpoint}`, {
const response = await fetch(`${API_BASE}/api/v1${endpoint}`, {
method,
headers,
body: isFormData ? (body as FormData) : body ? JSON.stringify(body) : undefined,
@ -89,7 +89,7 @@ export async function uploadFile(
headers['Authorization'] = `Bearer ${authToken}`;
}
const response = await fetch(`${API_BASE}/api${endpoint}`, {
const response = await fetch(`${API_BASE}/api/v1${endpoint}`, {
method: 'POST',
headers,
body: formData,
@ -137,7 +137,7 @@ export async function uploadFiles(
headers['Authorization'] = `Bearer ${authToken}`;
}
const response = await fetch(`${API_BASE}/api${endpoint}`, {
const response = await fetch(`${API_BASE}/api/v1${endpoint}`, {
method: 'POST',
headers,
body: formData,

View file

@ -27,7 +27,7 @@ export interface GenerateImageJobParams {
negativePrompt?: string;
width?: number;
height?: number;
numInferenceSteps?: number;
steps?: number;
guidanceScale?: number;
}

View file

@ -11,7 +11,7 @@ export interface GenerateImageParams {
negativePrompt?: string;
width?: number;
height?: number;
numInferenceSteps?: number;
steps?: number;
guidanceScale?: number;
}

View file

@ -91,7 +91,7 @@
modelId: selectedModelId,
width: advancedSettings.aspectRatio.width,
height: advancedSettings.aspectRatio.height,
numInferenceSteps: advancedSettings.steps,
steps: advancedSettings.steps,
guidanceScale: advancedSettings.guidanceScale,
});