Skip to content

Commit

Permalink
feat: add key feature and use bun instead of package.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunyawat Naunnak committed Aug 13, 2024
1 parent 5e72a29 commit 7e2f9a4
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/server/api/routers/parcel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,12 @@ export const parcelRouter = createTRPCRouter({
},
});

// Check if the student is an admin.
const isAdmin = await ctx.db.student.findFirst({
where: {
student_id: studentId,
isAdmin: true,
},
});
console.log("LOG-DEBUGGER ", isStudentInProject);

return await ctx.db.parcel.findMany({
where:
(isStudentInProject ?? isAdmin)
(isStudentInProject)
? { available: true, type: PARCEL_TYPE.KEY }
: projectId === "0000000000"
? { available: true, type: PARCEL_TYPE.KEY }
: {
available: true,
NOT: {
Expand Down

0 comments on commit 7e2f9a4

Please sign in to comment.