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

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 { ...@@ -149,7 +149,7 @@ export interface TransactionOptions extends Logging {
/** /**
* Parent transaction. * Parent transaction.
*/ */
transaction?: Transaction; transaction?: Transaction | null;
} }
export default Transaction; export default Transaction;
...@@ -110,6 +110,11 @@ User.addHook('beforeFind', 'test', (options: FindOptions<UserAttributes>) => { ...@@ -110,6 +110,11 @@ User.addHook('beforeFind', 'test', (options: FindOptions<UserAttributes>) => {
return undefined; 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 // Model#addScope
User.addScope('withoutFirstName', { User.addScope('withoutFirstName', {
where: { where: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!