mirror of
https://github.com/hay-kot/homebox.git
synced 2025-05-23 13:52:26 +00:00
fix: conditionally filter parent locations (#133)
This commit is contained in:
parent
fbcbde836a
commit
8e1947d971
18 changed files with 135 additions and 67 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue