mirror of
https://github.com/documenso/documenso.git
synced 2026-09-29 16:24:30 +10:00
chore(prisma): remove unregistered middleware (#3345)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user