Skip to content

Commit 1741bf0

Browse files
committed
IBX-9060: Simplified notification deletion flow.
1 parent f28b2c7 commit 1741bf0

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/bundle/Controller/NotificationController.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,25 +273,21 @@ public function deleteNotificationsAction(Request $request): Response
273273
}
274274

275275
if ($form->isValid()) {
276-
$result = $this->submitHandler->handle(
276+
return $this->submitHandler->handle(
277277
$form,
278-
function (NotificationSelectionData $data) {
278+
function (NotificationSelectionData $data): Response {
279279
return $this->processDeleteNotifications($data);
280280
}
281281
);
282-
283-
if ($result instanceof Response) {
284-
return $result;
285-
}
286-
} else {
287-
$this->notificationHandler->error(
288-
/** @Desc("An unexpected error occurred while deleting notifications.") */
289-
'error.unexpected_delete_notifications',
290-
[],
291-
'ibexa_notifications'
292-
);
293282
}
294283

284+
$this->notificationHandler->error(
285+
/** @Desc("An unexpected error occurred while deleting notifications.") */
286+
'error.unexpected_delete_notifications',
287+
[],
288+
'ibexa_notifications'
289+
);
290+
295291
return $this->redirectToRoute('ibexa.notifications.render.all');
296292
}
297293

0 commit comments

Comments
 (0)