chore: developer cleanup (#300)

* new PR tasks

* add homebox to know words

* formatting

* bump deps

* generate db models

* ts errors

* drop id

* fix accessor

* drop unused time field

* change CI

* add expected error

* add type check

* resolve serveral type errors

* hoise in CI
This commit is contained in:
Hayden 2023-02-17 21:41:01 -09:00 committed by GitHub
parent 88f9ff90d4
commit bd321af29f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
142 changed files with 817 additions and 1200 deletions

View file

@ -141,4 +141,8 @@ export class ItemsApi extends BaseAPI {
data: formData,
});
}
exportURL() {
return route("/items/export");
}
}

View file

@ -1,27 +1,7 @@
import { BaseAPI, route } from "../base";
export class ReportsAPI extends BaseAPI {
async billOfMaterials(): Promise<void> {
const { data: stream, error } = await this.http.get<ReadableStream>({ url: route("/reporting/bill-of-materials") });
if (error) {
return;
}
const reader = stream.getReader();
let data = "";
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
}
data += new TextDecoder("utf-8").decode(value);
}
const blob = new Blob([data], { type: "text/tsv" });
const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.download = "bill-of-materials.tsv";
link.click();
billOfMaterialsURL(): string {
return route("/reporting/bill-of-materials");
}
}