conform casing and documentation

This commit is contained in:
Hayden 2022-09-04 16:55:52 -08:00
parent 572f0f6689
commit a9f271d8c1
9 changed files with 58 additions and 50 deletions

View file

@ -1,4 +1,4 @@
import { BaseAPI, UrlBuilder } from '../base';
import { BaseAPI, route } from '../base';
import { Item } from './items';
import { Details, OutType, Results } from './types';
@ -15,21 +15,21 @@ export type LocationUpdate = LocationCreate;
export class LocationsApi extends BaseAPI {
async getAll() {
return this.http.get<Results<Location>>(UrlBuilder('/locations'));
return this.http.get<Results<Location>>(route('/locations'));
}
async create(location: LocationCreate) {
return this.http.post<LocationCreate, Location>(UrlBuilder('/locations'), location);
return this.http.post<LocationCreate, Location>(route('/locations'), location);
}
async get(id: string) {
return this.http.get<Location>(UrlBuilder(`/locations/${id}`));
return this.http.get<Location>(route(`/locations/${id}`));
}
async delete(id: string) {
return this.http.delete<void>(UrlBuilder(`/locations/${id}`));
return this.http.delete<void>(route(`/locations/${id}`));
}
async update(id: string, location: LocationUpdate) {
return this.http.put<LocationUpdate, Location>(UrlBuilder(`/locations/${id}`), location);
return this.http.put<LocationUpdate, Location>(route(`/locations/${id}`), location);
}
}