homebox/frontend/src/api/user.ts

19 lines
305 B
TypeScript
Raw Normal View History

2022-08-31 00:06:57 +00:00
import { BaseAPI, UrlBuilder } from './base';
export type Result<T> = {
item: T;
};
export type User = {
name: string;
email: string;
isSuperuser: boolean;
id: number;
};
export class UserApi extends BaseAPI {
public self() {
return this.http.get<Result<User>>(UrlBuilder('/users/self'));
}
}