fix(associate): associating one way is enough

fix(destroy): directly get a `destroy` method instead of find and destroy
This commit is contained in:
Mahdi Dibaiee
2016-03-31 20:40:01 +04:30
parent afb08670e8
commit 544dc23723
4 changed files with 7 additions and 14 deletions

View File

@ -157,11 +157,9 @@ export const destroy = (server, a, b, names) => {
}
});
const method = getMethod(base, names.b);
const method = getMethod(base, names.b, true, 'destroy');
const list = await method({ where, include });
await* list.map(instance => instance.destroy());
reply(list);
}
})
@ -185,7 +183,7 @@ export const destroyScope = (server, a, b, names) => {
}
});
const method = getMethod(base, names.b);
const method = getMethod(base, names.b, true, 'destroy');
const list = await method({
scope: request.params.scope,
where,