Skip to content

Commit

Permalink
fix: remove exitSudo
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanLyon committed Oct 23, 2024
1 parent fd9b2f5 commit ae05f84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions apps/keystone/src/schema/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
7 changes: 3 additions & 4 deletions apps/keystone/src/schema/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}
}
});

0 comments on commit ae05f84

Please sign in to comment.