forked from mirrors/homebox
fix: refactoring errors (#359)
* #352 - require one date to be set to save * fix many type regressions
This commit is contained in:
parent
4a8ba6231d
commit
97fb94d231
22 changed files with 164 additions and 289 deletions
|
@ -1,10 +1,9 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { LabelCreate, LabelOut } from "../types/data-contracts";
|
||||
import { Results } from "../types/non-generated";
|
||||
|
||||
export class LabelsApi extends BaseAPI {
|
||||
getAll() {
|
||||
return this.http.get<Results<LabelOut>>({ url: route("/labels") });
|
||||
return this.http.get<LabelOut[]>({ url: route("/labels") });
|
||||
}
|
||||
|
||||
create(body: LabelCreate) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { LocationOutCount, LocationCreate, LocationOut, LocationUpdate, TreeItem } from "../types/data-contracts";
|
||||
import { Results } from "../types/non-generated";
|
||||
|
||||
export type LocationsQuery = {
|
||||
filterChildren: boolean;
|
||||
|
@ -12,11 +11,11 @@ export type TreeQuery = {
|
|||
|
||||
export class LocationsApi extends BaseAPI {
|
||||
getAll(q: LocationsQuery = { filterChildren: false }) {
|
||||
return this.http.get<Results<LocationOutCount>>({ url: route("/locations", q) });
|
||||
return this.http.get<LocationOutCount[]>({ url: route("/locations", q) });
|
||||
}
|
||||
|
||||
getTree(tq = { withItems: false }) {
|
||||
return this.http.get<Results<TreeItem>>({ url: route("/locations/tree", tq) });
|
||||
return this.http.get<TreeItem[]>({ url: route("/locations/tree", tq) });
|
||||
}
|
||||
|
||||
create(body: LocationCreate) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue