leaflet_svelte/src/lib/api/scenarios.ts
2026-04-22 01:27:38 +09:00

11 lines
394 B
TypeScript

import { api } from './client';
import type { SavedScenario } from '$domain';
const base = '/saved-templates/';
export const scenariosApi = {
list: () => api.get<SavedScenario[]>(base),
create: (s: SavedScenario) => api.post<SavedScenario>(base, s),
update: (s: SavedScenario) => api.put<SavedScenario>(`${base}${s.id}/`, s),
delete: (id: number) => api.delete<void>(`${base}${id}/`),
};