Skip to content

Commit

Permalink
Merge pull request #19 from rocknrolla777/hotfix/deepdelete
Browse files Browse the repository at this point in the history
Hotfix/deepdelete
  • Loading branch information
rocknrolla777 authored Dec 22, 2017
2 parents 3eb8a6f + e419932 commit 4fa3b8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cascade-delete.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loopback-cascade-delete-mixin",
"version": "1.2.0",
"version": "1.2.1",
"description": "Loopback cascade delete mixin",
"main": "index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/cascade-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const cascadeDeletes = (modelId, Model, options) =>
where[relationKey] = modelId;

if (options.deepDelete) {
const instancesToDelete = await relationModel.find(where);
const instancesToDelete = await relationModel.find({ where });

instancesToDelete.forEach(async (instance) => {
await instance.destroy();
Expand Down

0 comments on commit 4fa3b8a

Please sign in to comment.