From 50bbb3832129e60532fc5c804a83887becddbdd7 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 5 Jan 2024 13:45:39 -0600 Subject: [PATCH] proper types for assetId --- backend/app/api/static/docs/docs.go | 2 +- backend/app/api/static/docs/swagger.json | 2 +- backend/app/api/static/docs/swagger.yaml | 2 +- backend/internal/data/repo/repo_items.go | 2 +- docs/docs/api/openapi-2.0.json | 2 +- frontend/lib/api/__test__/user/items.test.ts | 2 +- frontend/lib/api/types/data-contracts.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.go index 5be95b3..d5a8b71 100644 --- a/backend/app/api/static/docs/docs.go +++ b/backend/app/api/static/docs/docs.go @@ -2227,7 +2227,7 @@ const docTemplate = `{ "type": "boolean" }, "assetId": { - "type": "integer" + "type": "string" }, "description": { "type": "string" diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.json index dbbdba7..2ff1295 100644 --- a/backend/app/api/static/docs/swagger.json +++ b/backend/app/api/static/docs/swagger.json @@ -2220,7 +2220,7 @@ "type": "boolean" }, "assetId": { - "type": "integer" + "type": "string" }, "description": { "type": "string" diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yaml index 53a3b70..509d2cc 100644 --- a/backend/app/api/static/docs/swagger.yaml +++ b/backend/app/api/static/docs/swagger.yaml @@ -245,7 +245,7 @@ definitions: archived: type: boolean assetId: - type: integer + type: string description: type: string fields: diff --git a/backend/internal/data/repo/repo_items.go b/backend/internal/data/repo/repo_items.go index bd487c0..a454c1b 100644 --- a/backend/internal/data/repo/repo_items.go +++ b/backend/internal/data/repo/repo_items.go @@ -68,7 +68,7 @@ type ( ItemUpdate struct { ParentID uuid.UUID `json:"parentId" extensions:"x-nullable,x-omitempty"` ID uuid.UUID `json:"id"` - AssetID AssetID `json:"assetId"` + AssetID AssetID `json:"assetId" swaggertype:"string"` Name string `json:"name"` Description string `json:"description"` Quantity int `json:"quantity"` diff --git a/docs/docs/api/openapi-2.0.json b/docs/docs/api/openapi-2.0.json index dbbdba7..2ff1295 100644 --- a/docs/docs/api/openapi-2.0.json +++ b/docs/docs/api/openapi-2.0.json @@ -2220,7 +2220,7 @@ "type": "boolean" }, "assetId": { - "type": "integer" + "type": "string" }, "description": { "type": "string" diff --git a/frontend/lib/api/__test__/user/items.test.ts b/frontend/lib/api/__test__/user/items.test.ts index 698bd3f..72b54b1 100644 --- a/frontend/lib/api/__test__/user/items.test.ts +++ b/frontend/lib/api/__test__/user/items.test.ts @@ -9,7 +9,7 @@ import { sharedUserClient } from "../test-utils"; describe("user should be able to create an item and add an attachment", () => { let increment = 0; /** - * useLocatio sets up a location resource for testing, and returns a function + * useLocation sets up a location resource for testing, and returns a function * that can be used to delete the location from the backend server. */ async function useLocation(api: UserClient): Promise<[LocationOut, () => Promise]> { diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.ts index c264d03..67c4f9c 100644 --- a/frontend/lib/api/types/data-contracts.ts +++ b/frontend/lib/api/types/data-contracts.ts @@ -147,7 +147,7 @@ export interface ItemSummary { export interface ItemUpdate { archived: boolean; - assetId: number; + assetId: string; description: string; fields: ItemField[]; id: string;