mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-10 15:36:49 +02:00
🐛 Fix can’t delete user with deleted polls (#1405)
This commit is contained in:
parent
501cdd2b56
commit
82eb076c71
3 changed files with 6 additions and 14 deletions
|
@ -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>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue