🐛 Fix can’t delete user with deleted polls (#1405)

This commit is contained in:
Luke Vella 2024-10-20 21:00:59 +01:00 committed by GitHub
parent 501cdd2b56
commit 82eb076c71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 14 deletions

View file

@ -3,19 +3,7 @@ import { PrismaClient } from "@prisma/client";
export type * from "@prisma/client";
const prismaClientSingleton = () => {
return new PrismaClient().$extends({
query: {
poll: {
findMany: ({ args, query }) => {
if (!args.where?.deleted) {
args.where = { ...args.where, deleted: false };
}
return query(args);
},
},
},
});
return new PrismaClient();
};
export type ExtendedPrismaClient = ReturnType<typeof prismaClientSingleton>;