From 9f831188892f0d27fb838c0c126320bfb346fd3d Mon Sep 17 00:00:00 2001 From: John Szwaronek Date: Tue, 2 May 2017 09:30:57 -0400 Subject: [PATCH] Fixed softDelete issues #147, #163 --- src/services/soft-delete.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/soft-delete.js b/src/services/soft-delete.js index cf8b368f..73cc2789 100755 --- a/src/services/soft-delete.js +++ b/src/services/soft-delete.js @@ -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'); @@ -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.');