Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-artuso committed Jan 25, 2024
1 parent c1feb4a commit 5239af0
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ export class TransactionalAdapterPgPromise
fn: (...args: any[]) => Promise<any>,
setClient: (client?: PgPromiseDbOrTx) => void,
) => {
const txCb = (tx: ITask<unknown>) => {
setClient(tx);
return fn();
};
const txArgs = options
? ([options, txCb] as const)
: ([txCb] as const);
return pgPromiseDbOrTxInstance.tx.apply(null, txArgs);
return pgPromiseDbOrTxInstance.tx(
options ?? {},
(tx: ITask<unknown>) => {
setClient(tx);
return fn();
},
);
},
getFallbackInstance: () => pgPromiseDbOrTxInstance,
});
Expand Down

0 comments on commit 5239af0

Please sign in to comment.