Refactor resolving actionable bulk action ids to listing repository
[MAILPOET-2898]
This commit is contained in:
committed by
Veljko V
parent
91d2d92bbd
commit
8a78322854
@ -352,12 +352,8 @@ class Newsletters extends APIEndpoint {
|
||||
}
|
||||
|
||||
public function bulkAction($data = []) {
|
||||
if (isset($data['listing']['selection']) && is_array($data['listing']['selection'])) {
|
||||
$ids = array_map('intval', $data['listing']['selection']);
|
||||
} else {
|
||||
$definition = $this->listingHandler->getListingDefinition($data);
|
||||
$ids = $this->newsletterListingRepository->getIds($definition);
|
||||
}
|
||||
$definition = $this->listingHandler->getListingDefinition($data['listing']);
|
||||
$ids = $this->newsletterListingRepository->getActionableIds($definition);
|
||||
if ($data['action'] === 'trash') {
|
||||
$this->newslettersRepository->bulkTrash($ids);
|
||||
} elseif ($data['action'] === 'restore') {
|
||||
|
Reference in New Issue
Block a user