import { BaseAPI, route } from "../base"; import { LocationOutCount, LocationCreate, LocationOut } from "../types/data-contracts"; import { Results } from "./types"; export type LocationUpdate = LocationCreate; export class LocationsApi extends BaseAPI { getAll() { return this.http.get>({ url: route("/locations") }); } create(body: LocationCreate) { return this.http.post({ url: route("/locations"), body }); } get(id: string) { return this.http.get({ url: route(`/locations/${id}`) }); } delete(id: string) { return this.http.delete({ url: route(`/locations/${id}`) }); } update(id: string, body: LocationUpdate) { return this.http.put({ url: route(`/locations/${id}`), body }); } }