chore(prisma): remove unregistered middleware (#3345)

This commit is contained in:
Ephraim Duncan
2026-09-16 13:53:19 +10:00
committed by GitHub
parent b795883fc7
commit 0f71a8b67d
-25
View File
@@ -1,25 +0,0 @@
import type { PrismaClient } from '@prisma/client';
export function addPrismaMiddleware(prisma: PrismaClient) {
prisma.$use(async (params, next) => {
// Check if we're creating a new team
if (params.model === 'Team' && params.action === 'create') {
// Execute the team creation
const result = await next(params);
// Create the TeamGlobalSettings
await prisma.teamGlobalSettings.create({
data: {
teamId: result.id,
},
});
return result;
}
// For all other operations, just pass through
return next(params);
});
return prisma;
}