Refactor bulk action into reusable controller

[MAILPOET-1689]
This commit is contained in:
Rostislav Wolny
2018-12-13 17:24:13 +01:00
parent 5c8e99dcf3
commit 2839c86017
7 changed files with 42 additions and 62 deletions

View File

@ -280,11 +280,8 @@ class Forms extends APIEndpoint {
function bulkAction($data = array()) {
try {
$bulk_action = new Listing\BulkAction(
'\MailPoet\Models\Form',
$data
);
$meta = $bulk_action->apply();
$bulk_action = new Listing\BulkActionController();
$meta = $bulk_action->apply('\MailPoet\Models\Form', $data);
return $this->successResponse(null, $meta);
} catch(\Exception $e) {
return $this->errorResponse(array(