fix: remove logging from prisma client and fix users API routes
This commit is contained in:
@@ -73,7 +73,7 @@ export async function PATCH(
|
||||
|
||||
// Update the user's role
|
||||
const updatedUser = await prisma.user.update({
|
||||
where: { id: params.id },
|
||||
where: { id },
|
||||
data: { role }
|
||||
});
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export async function PATCH(
|
||||
|
||||
// Check if user exists
|
||||
const user = await prisma.user.findUnique({
|
||||
where: { id: params.id },
|
||||
where: { id },
|
||||
include: { player: true }
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ export async function PATCH(
|
||||
}
|
||||
|
||||
const updatedUser = await prisma.user.update({
|
||||
where: { id: params.id },
|
||||
where: { id },
|
||||
data: updateData,
|
||||
include: { player: true }
|
||||
});
|
||||
|
||||
@@ -11,15 +11,6 @@ const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
||||
// Create PrismaClient with adapter
|
||||
const createPrismaClient = () => {
|
||||
const client = new PrismaClient({ adapter })
|
||||
|
||||
// Add logging if in development
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
client.$on('query', (e) => {
|
||||
console.log('Query:', e.query)
|
||||
console.log('Duration:', e.duration, 'ms')
|
||||
})
|
||||
}
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user