Skip to content

Commit

Permalink
Resolved code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
DumitracheAdrian committed May 20, 2024
1 parent d26ff71 commit 4fe9954
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,22 @@ public function configureListFields(ListMapper $list): void
}
}

$actions = [];
$routes = $admin->getRoutes();

foreach ($this->actions as $action => $options) {
if (!$routes->has($routes->getCode($action))) {
unset($this->actions[$action]);
if ($routes->has($routes->getCode($action))) {
$actions[$action] = $options;
}
}

if (!empty($this->actions)) {
if (!empty($actions)) {
$list->add(
ListMapper::NAME_ACTIONS,
ListMapper::TYPE_ACTIONS,
[
'label' => 'Action',
'actions' => $this->actions,
'actions' => $actions,
]
);
}
Expand Down

0 comments on commit 4fe9954

Please sign in to comment.