Refactor bulk action into reusable controller
[MAILPOET-1689]
This commit is contained in:
@ -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(
|
||||
|
Reference in New Issue
Block a user