*/
@ToadletPath("dismissNotification.html")
class DismissNotificationPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
- SoneTemplatePage("dismissNotification.html", webInterface, loaders, templateRenderer, pageTitleKey = "Page.DismissNotification.Title") {
+ SoneTemplatePage(webInterface, loaders, templateRenderer, pageTitleKey = "Page.DismissNotification.Title") {
override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) {
val returnPage = soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)
val notificationId = soneRequest.httpRequest.getPartAsStringFailsafe("notification", 36)
soneRequest.webInterface.getNotification(notificationId).orNull()?.takeIf { it.isDismissable }?.dismiss()
- throw RedirectException(returnPage)
+ redirectTo(returnPage)
}
}