diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 0ea5f91..f7e37e6 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -34,6 +34,11 @@ enum Location { OTHER } +enum RetrieveLocation { + CUC + GHC +} + enum Category { CLOTHING CHARGER @@ -102,7 +107,7 @@ model Item { color Color value Value identifiable Boolean - retrieveLocation Location + retrieveLocation RetrieveLocation itemLocation String longDescription String? auditLogs AuditLog[] diff --git a/src/pages/manage/items/create.tsx b/src/pages/manage/items/create.tsx index 0b1a5e7..b47f40f 100644 --- a/src/pages/manage/items/create.tsx +++ b/src/pages/manage/items/create.tsx @@ -8,6 +8,7 @@ import { Color, ItemInteraction, Location, + RetrieveLocation, Value } from '@prisma/client'; import MyListbox from 'components/Form/Listbox'; @@ -17,7 +18,7 @@ import { ItemCreateSchema } from 'lib/schemas'; import { useRouter } from 'next/router'; import { NextPageWithLayout } from 'pages/_app'; import { toast } from 'react-toastify'; -import { Categories, Colors, Locations } from 'types'; +import { Categories, Colors, Locations, RetrieveLocations } from 'types'; import { trpc } from 'utils/trpc'; const CreateItem: NextPageWithLayout = () => { @@ -219,8 +220,8 @@ const CreateItem: NextPageWithLayout = () => { Locations[prop]} + values={Object.values(RetrieveLocation)} + displayValue={(prop) => RetrieveLocations[prop]} keyValue={(prop) => prop} name="retrieveLocation" control={methods.control} diff --git a/src/types/index.ts b/src/types/index.ts index b6d12da..a074eef 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,4 +1,4 @@ -import { Category, Color, Location } from '@prisma/client'; +import { Category, Color, Location, RetrieveLocation } from '@prisma/client'; export const Locations: Record = { AN: 'Ansys Hall', @@ -23,6 +23,12 @@ export const Locations: Record = { TEP: 'Tepper Quad', OTHER: 'Other' }; + +export const RetrieveLocations: Record = { + CUC: 'Cohon University Center', + GHC: 'Gates and Hillman Centers' +}; + export const Colors: Record = { BLACK: 'Black', BLUE: 'Blue',