Skip to content

Commit

Permalink
test: ignore transaction missing when beginTransaction undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRibbens committed Jul 31, 2024
1 parent 2fa445e commit d5c2e9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/hooks/collections/Hook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Hooks: CollectionConfig = {
hooks: {
beforeOperation: [
({ req }) => {
if (!req.transactionID) {
if (typeof req.payload.db.beginTransaction === 'function' && !req.transactionID) {
throw new Error('transactionID is missing in beforeOperation hook')
}
},
Expand Down

0 comments on commit d5c2e9d

Please sign in to comment.