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';
|
||||
import { Details, OutType, Results } from './types';
|
||||
|
||||
export type LabelCreate = Details & {
|
||||
|
@ -14,22 +14,22 @@ export type Label = LabelCreate &
|
|||
|
||||
export class LabelsApi extends BaseAPI {
|
||||
async getAll() {
|
||||
return this.http.get<Results<Label>>(UrlBuilder('/labels'));
|
||||
return this.http.get<Results<Label>>(route('/labels'));
|
||||
}
|
||||
|
||||
async create(label: LabelCreate) {
|
||||
return this.http.post<LabelCreate, Label>(UrlBuilder('/labels'), label);
|
||||
return this.http.post<LabelCreate, Label>(route('/labels'), label);
|
||||
}
|
||||
|
||||
async get(id: string) {
|
||||
return this.http.get<Label>(UrlBuilder(`/labels/${id}`));
|
||||
return this.http.get<Label>(route(`/labels/${id}`));
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
return this.http.delete<void>(UrlBuilder(`/labels/${id}`));
|
||||
return this.http.delete<void>(route(`/labels/${id}`));
|
||||
}
|
||||
|
||||
async update(id: string, label: LabelUpdate) {
|
||||
return this.http.put<LabelUpdate, Label>(UrlBuilder(`/labels/${id}`), label);
|
||||
return this.http.put<LabelUpdate, Label>(route(`/labels/${id}`), label);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue