Skip to content

Commit

Permalink
Fixed softDelete issues #147, #163
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyystop committed May 2, 2017
1 parent 0f15a0d commit 9f83118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/soft-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function (field) {
const deleteField = field || 'deleted';

return function (hook) {
const service = this;
const service = hook.service;
hook.data = hook.data || {};
hook.params.query = hook.params.query || {};
checkContext(hook, 'before', null, 'softDelete');
Expand Down Expand Up @@ -59,7 +59,7 @@ export default function (field) {
}

function throwIfItemDeleted (id) {
return service.get(id, { query: { $disableSoftDelete: true } })
return service.get(id, { query: { $disableSoftDelete: true }, provider: hook.params.provider })
.then(data => {
if (data[deleteField]) {
throw new errors.NotFound('Item has been soft deleted.');
Expand Down

0 comments on commit 9f83118

Please sign in to comment.