11 lines
422 B
TypeScript
11 lines
422 B
TypeScript
import { api } from './client';
|
|
import type { SavedFlightProfile } from '$domain';
|
|
|
|
const base = '/saved-profiles/';
|
|
|
|
export const profilesApi = {
|
|
list: () => api.get<SavedFlightProfile[]>(base),
|
|
create: (p: SavedFlightProfile) => api.post<SavedFlightProfile>(base, p),
|
|
update: (p: SavedFlightProfile) => api.put<SavedFlightProfile>(`${base}${p.id}/`, p),
|
|
delete: (id: number) => api.delete<void>(`${base}${id}/`),
|
|
};
|