forked from mirrors/homebox
conform casing and documentation
This commit is contained in:
parent
572f0f6689
commit
a9f271d8c1
9 changed files with 58 additions and 50 deletions
|
@ -1,4 +1,4 @@
|
|||
import { BaseAPI, UrlBuilder } from './base';
|
||||
import { BaseAPI, route } from './base';
|
||||
|
||||
export type LoginResult = {
|
||||
token: string;
|
||||
|
@ -28,17 +28,17 @@ export type StatusResult = {
|
|||
|
||||
export class PublicApi extends BaseAPI {
|
||||
public status() {
|
||||
return this.http.get<StatusResult>(UrlBuilder('/status'));
|
||||
return this.http.get<StatusResult>(route('/status'));
|
||||
}
|
||||
|
||||
public login(username: string, password: string) {
|
||||
return this.http.post<LoginPayload, LoginResult>(UrlBuilder('/users/login'), {
|
||||
return this.http.post<LoginPayload, LoginResult>(route('/users/login'), {
|
||||
username,
|
||||
password,
|
||||
});
|
||||
}
|
||||
|
||||
public register(payload: RegisterPayload) {
|
||||
return this.http.post<RegisterPayload, LoginResult>(UrlBuilder('/users/register'), payload);
|
||||
return this.http.post<RegisterPayload, LoginResult>(route('/users/register'), payload);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue