Skip to content

Commit

Permalink
fix(types): add hooks to InstanceDestroyOptions type (#13491)
Browse files Browse the repository at this point in the history
Co-authored-by: Sascha Depold <sdepold@users.noreply.github.com>
Co-authored-by: Zoé <zoe@ephys.dev>
  • Loading branch information
3 people committed Jan 22, 2022
1 parent b06c1fc commit dbd9ea8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/lib/model.d.ts
Expand Up @@ -960,7 +960,7 @@ export interface InstanceRestoreOptions extends Logging, Transactionable { }
/**
* Options used for Instance.destroy method
*/
export interface InstanceDestroyOptions extends Logging, Transactionable {
export interface InstanceDestroyOptions extends Logging, Transactionable, Hookable {
/**
* If set to true, paranoid models will actually be deleted
*/
Expand Down
14 changes: 14 additions & 0 deletions types/test/destroy.ts
@@ -0,0 +1,14 @@
import { User } from './models/User';

(async () => {
const user = await User.create();

await user.destroy({
hooks: true
});

await User.destroy({
hooks: false,
where: { firstName: 'John' }
});
})();

0 comments on commit dbd9ea8

Please sign in to comment.