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:
Hayden 2023-06-02 14:56:40 -07:00 committed by GitHub
parent 4dd036abb2
commit ef1531e561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 353 additions and 163 deletions

View file

@ -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);