fix(frontend): sprint 5 — correct API path /simulation-templates → /templates
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,19 +6,19 @@ import type {
|
||||
} from './types';
|
||||
|
||||
export async function listTemplates(): Promise<SimulationTemplate[]> {
|
||||
const { data } = await apiClient.get<SimulationTemplate[]>('/simulation-templates');
|
||||
const { data } = await apiClient.get<SimulationTemplate[]>('/templates');
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getTemplate(id: number): Promise<SimulationTemplate> {
|
||||
const { data } = await apiClient.get<SimulationTemplate>(`/simulation-templates/${id}`);
|
||||
const { data } = await apiClient.get<SimulationTemplate>(`/templates/${id}`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function createTemplate(
|
||||
input: SimulationTemplateCreateInput,
|
||||
): Promise<SimulationTemplate> {
|
||||
const { data } = await apiClient.post<SimulationTemplate>('/simulation-templates', input);
|
||||
const { data } = await apiClient.post<SimulationTemplate>('/templates', input);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ export async function updateTemplate(
|
||||
id: number,
|
||||
patch: SimulationTemplatePatchInput,
|
||||
): Promise<SimulationTemplate> {
|
||||
const { data } = await apiClient.patch<SimulationTemplate>(`/simulation-templates/${id}`, patch);
|
||||
const { data } = await apiClient.patch<SimulationTemplate>(`/templates/${id}`, patch);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function deleteTemplate(id: number): Promise<void> {
|
||||
await apiClient.delete(`/simulation-templates/${id}`);
|
||||
await apiClient.delete(`/templates/${id}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user