diff --git a/backend/app/tools/typegen/main.go b/backend/app/tools/typegen/main.go index bc04cc9..5f4d8da 100644 --- a/backend/app/tools/typegen/main.go +++ b/backend/app/tools/typegen/main.go @@ -54,6 +54,7 @@ func main() { NewReReplace(` Services`, " "), NewReReplace(` V1`, " "), NewReReplace(`\?:`, ":"), + NewReReplace(`(\w+):\s(.*null.*)`, "$1?: $2"), // make null union types optional NewReDate("createdAt"), NewReDate("updatedAt"), NewReDate("soldTime"), diff --git a/backend/go.sum b/backend/go.sum index 2746d2f..d35f134 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -506,6 +506,7 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -531,6 +532,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= @@ -602,8 +604,10 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.ts index a49fadf..a2d7209 100644 --- a/frontend/lib/api/types/data-contracts.ts +++ b/frontend/lib/api/types/data-contracts.ts @@ -67,7 +67,7 @@ export interface ItemCreate { * @maxLength 255 */ name: string; - parentId: string | null; + parentId?: string | null; } export interface ItemField { @@ -94,13 +94,13 @@ export interface ItemOut { /** Warranty */ lifetimeWarranty: boolean; /** Edges */ - location: LocationSummary | null; + location?: LocationSummary | null; manufacturer: string; modelNumber: string; name: string; /** Extras */ notes: string; - parent: ItemSummary | null; + parent?: ItemSummary | null; purchaseFrom: string; /** @example "0" */ purchasePrice: string; @@ -121,7 +121,7 @@ export interface ItemOut { export interface ItemPatch { id: string; - quantity: number | null; + quantity?: number | null; } export interface ItemSummary { @@ -132,7 +132,7 @@ export interface ItemSummary { insured: boolean; labels: LabelSummary[]; /** Edges */ - location: LocationSummary | null; + location?: LocationSummary | null; name: string; /** @example "0" */ purchasePrice: string; @@ -157,7 +157,7 @@ export interface ItemUpdate { name: string; /** Extras */ notes: string; - parentId: string | null; + parentId?: string | null; purchaseFrom: string; /** @example "0" */ purchasePrice: string; @@ -208,7 +208,7 @@ export interface LabelSummary { export interface LocationCreate { description: string; name: string; - parentId: string | null; + parentId?: string | null; } export interface LocationOut { @@ -243,7 +243,7 @@ export interface LocationUpdate { description: string; id: string; name: string; - parentId: string | null; + parentId?: string | null; } export interface MaintenanceEntry { @@ -314,7 +314,7 @@ export interface NotifierUpdate { * @maxLength 255 */ name: string; - url: string | null; + url?: string | null; } export interface PaginationResultItemSummary { diff --git a/frontend/pages/item/[id]/index.vue b/frontend/pages/item/[id]/index.vue index da13225..9271675 100644 --- a/frontend/pages/item/[id]/index.vue +++ b/frontend/pages/item/[id]/index.vue @@ -51,6 +51,7 @@ } const resp = await api.items.patch(item.value.id, { + id: item.value.id, quantity: newQuantity, });