不要怂,就是干,撸起袖子干!

Commit cd2de406 by Ariel Barabas Committed by GitHub

fix(typings): make `Transactionable` compatible with `TransactionOptions` (#13334)

Co-authored-by: Pedro Augusto de Paula Barbosa <papb1996@gmail.com>
1 parent 1a16b915
......@@ -149,7 +149,7 @@ export interface TransactionOptions extends Logging {
/**
* Parent transaction.
*/
transaction?: Transaction;
transaction?: Transaction | null;
}
export default Transaction;
......@@ -110,6 +110,11 @@ User.addHook('beforeFind', 'test', (options: FindOptions<UserAttributes>) => {
return undefined;
});
User.addHook('afterDestroy', async (instance, options) => {
// `options` from `afterDestroy` should be passable to `sequelize.transaction`
await instance.sequelize.transaction(options, async () => undefined);
});
// Model#addScope
User.addScope('withoutFirstName', {
where: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!