mirror of
https://github.com/hay-kot/homebox.git
synced 2025-05-30 00:52:29 +00:00
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:
parent
88f9ff90d4
commit
bd321af29f
142 changed files with 817 additions and 1200 deletions
|
@ -141,4 +141,8 @@ export class ItemsApi extends BaseAPI {
|
|||
data: formData,
|
||||
});
|
||||
}
|
||||
|
||||
exportURL() {
|
||||
return route("/items/export");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue