mirror of
https://github.com/hay-kot/homebox.git
synced 2025-05-29 16:42:31 +00:00
feat: easily increment quantity (#473)
* fix vue version issue * new patch API endpoint * doc-gen * new API class method for patch operations * add quantity patch UI support * fix typegen errors * fix ts errors
This commit is contained in:
parent
4dd036abb2
commit
ef1531e561
16 changed files with 353 additions and 163 deletions
|
@ -4,6 +4,7 @@ import {
|
|||
ItemAttachmentUpdate,
|
||||
ItemCreate,
|
||||
ItemOut,
|
||||
ItemPatch,
|
||||
ItemSummary,
|
||||
ItemUpdate,
|
||||
MaintenanceEntry,
|
||||
|
@ -138,6 +139,20 @@ export class ItemsApi extends BaseAPI {
|
|||
return payload;
|
||||
}
|
||||
|
||||
async patch(id: string, item: ItemPatch) {
|
||||
const resp = await this.http.patch<ItemPatch, ItemOut>({
|
||||
url: route(`/items/${id}`),
|
||||
body: this.dropFields(item),
|
||||
});
|
||||
|
||||
if (!resp.data) {
|
||||
return resp;
|
||||
}
|
||||
|
||||
resp.data = parseDate(resp.data, ["purchaseTime", "soldTime", "warrantyExpires"]);
|
||||
return resp;
|
||||
}
|
||||
|
||||
import(file: File | Blob) {
|
||||
const formData = new FormData();
|
||||
formData.append("csv", file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue