mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-03 16:20:27 +00:00
update typing
This commit is contained in:
parent
1476552456
commit
2cb0f75220
1 changed files with 2 additions and 8 deletions
|
@ -2,19 +2,13 @@ import { BaseAPI, route } from "./base";
|
||||||
import { ItemsApi } from "./classes/items";
|
import { ItemsApi } from "./classes/items";
|
||||||
import { LabelsApi } from "./classes/labels";
|
import { LabelsApi } from "./classes/labels";
|
||||||
import { LocationsApi } from "./classes/locations";
|
import { LocationsApi } from "./classes/locations";
|
||||||
|
import { UserOut } from "./types/data-contracts";
|
||||||
import { Requests } from "~~/lib/requests";
|
import { Requests } from "~~/lib/requests";
|
||||||
|
|
||||||
export type Result<T> = {
|
export type Result<T> = {
|
||||||
item: T;
|
item: T;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type User = {
|
|
||||||
name: string;
|
|
||||||
email: string;
|
|
||||||
isSuperuser: boolean;
|
|
||||||
id: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class UserApi extends BaseAPI {
|
export class UserApi extends BaseAPI {
|
||||||
locations: LocationsApi;
|
locations: LocationsApi;
|
||||||
labels: LabelsApi;
|
labels: LabelsApi;
|
||||||
|
@ -30,7 +24,7 @@ export class UserApi extends BaseAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
public self() {
|
public self() {
|
||||||
return this.http.get<Result<User>>({ url: route("/users/self") });
|
return this.http.get<Result<UserOut>>({ url: route("/users/self") });
|
||||||
}
|
}
|
||||||
|
|
||||||
public logout() {
|
public logout() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue