From 5e72a2932ecc2b5d6b2592ad051b331b3ce2878e Mon Sep 17 00:00:00 2001 From: Bunyawat Naunnak Date: Wed, 14 Aug 2024 02:04:55 +0700 Subject: [PATCH] feat: add key feature and use bun instead of package.lock --- src/server/api/routers/parcel.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/api/routers/parcel.ts b/src/server/api/routers/parcel.ts index 78987bf..3bc06a0 100755 --- a/src/server/api/routers/parcel.ts +++ b/src/server/api/routers/parcel.ts @@ -7,7 +7,7 @@ import { ParcelGroupSchema, ParcelTypeSchema, } from "~/utils/constant"; -import { BORROWING_STATUS } from "@prisma/client"; +import { BORROWING_STATUS, PARCEL_TYPE } from "@prisma/client"; /** * TRPC Router for handling parcel-related operations. @@ -64,10 +64,10 @@ export const parcelRouter = createTRPCRouter({ return await ctx.db.parcel.findMany({ where: - isStudentInProject ?? isAdmin - ? { available: true, type: "KEY" } + (isStudentInProject ?? isAdmin) + ? { available: true, type: PARCEL_TYPE.KEY } : projectId === "0000000000" - ? { available: true, type: "KEY" } + ? { available: true, type: PARCEL_TYPE.KEY } : { available: true, NOT: {