mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-27 14:18:35 +00:00
frontend: cleanup
* dummy commit * cleanup workflows * setup and run eslint * add linter to CI * use eslint for formatting * reorder rules * drop editor config
This commit is contained in:
parent
78fa714297
commit
75c633dcb5
65 changed files with 2048 additions and 641 deletions
|
@ -1,7 +1,7 @@
|
|||
import { BaseAPI, route } from '../base';
|
||||
import { Label } from './labels';
|
||||
import { Location } from './locations';
|
||||
import { Results } from './types';
|
||||
import { BaseAPI, route } from "../base";
|
||||
import { Label } from "./labels";
|
||||
import { Location } from "./locations";
|
||||
import { Results } from "./types";
|
||||
|
||||
export interface ItemCreate {
|
||||
name: string;
|
||||
|
@ -35,12 +35,12 @@ export interface Item {
|
|||
}
|
||||
|
||||
export class ItemsApi extends BaseAPI {
|
||||
async getAll() {
|
||||
return this.http.get<Results<Item>>({ url: route('/items') });
|
||||
getAll() {
|
||||
return this.http.get<Results<Item>>({ url: route("/items") });
|
||||
}
|
||||
|
||||
async create(item: ItemCreate) {
|
||||
return this.http.post<ItemCreate, Item>({ url: route('/items'), body: item });
|
||||
create(item: ItemCreate) {
|
||||
return this.http.post<ItemCreate, Item>({ url: route("/items"), body: item });
|
||||
}
|
||||
|
||||
async get(id: string) {
|
||||
|
@ -58,18 +58,18 @@ export class ItemsApi extends BaseAPI {
|
|||
return payload;
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
delete(id: string) {
|
||||
return this.http.delete<void>({ url: route(`/items/${id}`) });
|
||||
}
|
||||
|
||||
async update(id: string, item: ItemCreate) {
|
||||
update(id: string, item: ItemCreate) {
|
||||
return this.http.put<ItemCreate, Item>({ url: route(`/items/${id}`), body: item });
|
||||
}
|
||||
|
||||
async import(file: File) {
|
||||
import(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('csv', file);
|
||||
formData.append("csv", file);
|
||||
|
||||
return this.http.post<FormData, void>({ url: route('/items/import'), data: formData });
|
||||
return this.http.post<FormData, void>({ url: route("/items/import"), data: formData });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseAPI, route } from '../base';
|
||||
import { Item } from './items';
|
||||
import { Details, OutType, Results } from './types';
|
||||
import { BaseAPI, route } from "../base";
|
||||
import { Item } from "./items";
|
||||
import { Details, OutType, Results } from "./types";
|
||||
|
||||
export type LabelCreate = Details & {
|
||||
color: string;
|
||||
|
@ -15,23 +15,23 @@ export type Label = LabelCreate &
|
|||
};
|
||||
|
||||
export class LabelsApi extends BaseAPI {
|
||||
async getAll() {
|
||||
return this.http.get<Results<Label>>({ url: route('/labels') });
|
||||
getAll() {
|
||||
return this.http.get<Results<Label>>({ url: route("/labels") });
|
||||
}
|
||||
|
||||
async create(body: LabelCreate) {
|
||||
return this.http.post<LabelCreate, Label>({ url: route('/labels'), body });
|
||||
create(body: LabelCreate) {
|
||||
return this.http.post<LabelCreate, Label>({ url: route("/labels"), body });
|
||||
}
|
||||
|
||||
async get(id: string) {
|
||||
get(id: string) {
|
||||
return this.http.get<Label>({ url: route(`/labels/${id}`) });
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
delete(id: string) {
|
||||
return this.http.delete<void>({ url: route(`/labels/${id}`) });
|
||||
}
|
||||
|
||||
async update(id: string, body: LabelUpdate) {
|
||||
update(id: string, body: LabelUpdate) {
|
||||
return this.http.put<LabelUpdate, Label>({ url: route(`/labels/${id}`), body });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseAPI, route } from '../base';
|
||||
import { Item } from './items';
|
||||
import { Details, OutType, Results } from './types';
|
||||
import { BaseAPI, route } from "../base";
|
||||
import { Item } from "./items";
|
||||
import { Details, OutType, Results } from "./types";
|
||||
|
||||
export type LocationCreate = Details;
|
||||
|
||||
|
@ -14,22 +14,23 @@ export type Location = LocationCreate &
|
|||
export type LocationUpdate = LocationCreate;
|
||||
|
||||
export class LocationsApi extends BaseAPI {
|
||||
async getAll() {
|
||||
return this.http.get<Results<Location>>({ url: route('/locations') });
|
||||
getAll() {
|
||||
return this.http.get<Results<Location>>({ url: route("/locations") });
|
||||
}
|
||||
|
||||
async create(body: LocationCreate) {
|
||||
return this.http.post<LocationCreate, Location>({ url: route('/locations'), body });
|
||||
create(body: LocationCreate) {
|
||||
return this.http.post<LocationCreate, Location>({ url: route("/locations"), body });
|
||||
}
|
||||
|
||||
async get(id: string) {
|
||||
get(id: string) {
|
||||
return this.http.get<Location>({ url: route(`/locations/${id}`) });
|
||||
}
|
||||
async delete(id: string) {
|
||||
|
||||
delete(id: string) {
|
||||
return this.http.delete<void>({ url: route(`/locations/${id}`) });
|
||||
}
|
||||
|
||||
async update(id: string, body: LocationUpdate) {
|
||||
update(id: string, body: LocationUpdate) {
|
||||
return this.http.put<LocationUpdate, Location>({ url: route(`/locations/${id}`), body });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue