@@ -74,4 +74,10 @@ class DashboardController extends ActionController
$this->termController->createAction($terms, $categoryObj, $typeObj, $urlObj);
$this->redirect('index');
}
+
+ public function deleteTermAction(int $termId): void {
+ $this->termController->deleteAction($termId);
+ $this->redirect('index');
+ }
@@ -23,4 +23,11 @@ class TermController extends ActionController
$this->termRepository->add($termObj);
+ public function deleteAction(int $termId): void {
+ $term = $this->termRepository->findByUid($termId);
+ if ($term) {
+ $this->termRepository->remove($term);
@@ -44,6 +44,9 @@
<td>{term.type.title}</td>
<td>{term.category.title}</td>
<td>{term.url.title}</td>
+ <td>
+ <f:link.action action="deleteTerm" arguments="{termId: term.uid}" class="btn btn-danger" title="Delete" onclick="return confirm('Are you sure you want to delete this term?');">Delete</f:link.action>
+ </td>
</tr>
</f:for>
</tbody>
@@ -12,7 +12,7 @@ call_user_func(function()
'ChatbotBegriffManagement',
'top',
[
- DashboardController::class => 'index, list, create',
+ DashboardController::class => 'index, list, create, deleteTerm',
],
'access' => 'user,admin',