conditionally filter parent locations

This commit is contained in:
Hayden 2022-11-02 11:29:17 -08:00
parent fbcbde836a
commit 8a71a51c43
No known key found for this signature in database
GPG key ID: 17CF79474E257545
18 changed files with 135 additions and 67 deletions

View file

@ -2,9 +2,13 @@ import { BaseAPI, route } from "../base";
import { LocationOutCount, LocationCreate, LocationOut, LocationUpdate } from "../types/data-contracts";
import { Results } from "../types/non-generated";
export type LocationsQuery = {
filterChildren: boolean;
};
export class LocationsApi extends BaseAPI {
getAll() {
return this.http.get<Results<LocationOutCount>>({ url: route("/locations") });
getAll(q: LocationsQuery = { filterChildren: false }) {
return this.http.get<Results<LocationOutCount>>({ url: route("/locations", q) });
}
create(body: LocationCreate) {