diff --git a/apps/keystone/src/schema/user.ts b/apps/keystone/src/schema/user.ts index e2c51c3..d02270d 100644 --- a/apps/keystone/src/schema/user.ts +++ b/apps/keystone/src/schema/user.ts @@ -209,6 +209,4 @@ async function SendVerification(data: { item: Lists.User.TypeInfo['item'], conte // console.log(await sudoContext.db.Verification.findMany()); sendEmailVerification(item.email, newVerification.code); - - sudoContext.exitSudo(); } diff --git a/apps/keystone/src/schema/verification.ts b/apps/keystone/src/schema/verification.ts index af836e5..b1abdc3 100644 --- a/apps/keystone/src/schema/verification.ts +++ b/apps/keystone/src/schema/verification.ts @@ -2,8 +2,6 @@ import { list } from '@keystone-6/core'; import { Lists } from '.keystone/types'; import { text } from '@keystone-6/core/fields'; -import { ListFilterAccessControl } from '@keystone-6/core/types'; -import { SessionContext } from './access'; // const filterVerification: ListFilterAccessControl<"query", Lists.Verification.TypeInfo> = ({ session }: SessionContext) => { // // if (!session?.data) return false; @@ -33,11 +31,12 @@ export const Verification: Lists.Verification = list({ if (operation === 'delete') { const sudoContext = context.sudo(); sudoContext.db.User.updateOne({ where: { id: (originalItem.account as string) }, data: { verified: true } }); - sudoContext.exitSudo(); } } }, graphql: { - omit: ['query'] + omit: { + query: true + } } });