X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FUnbookmarkPage.kt;h=aa7bbf6476675e452b660ad3c775768cc686c9f8;hp=7759fb74b3f19bd0e3d09a6f53cf4f7445982fa9;hb=aaf780d3c2a6f5ce47295786f3963c8b93f6a145;hpb=c389ee8f5e6eacae70438c3f364e8674c09d1959 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPage.kt index 7759fb7..aa7bbf6 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPage.kt @@ -13,7 +13,7 @@ import javax.inject.* */ @ToadletPath("unbookmark.html") class UnbookmarkPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : - SoneTemplatePage("unbookmark.html", webInterface, loaders, templateRenderer, pageTitleKey = "Page.Unbookmark.Title") { + SoneTemplatePage(webInterface, loaders, templateRenderer, pageTitleKey = "Page.Unbookmark.Title") { override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) { when { @@ -21,13 +21,13 @@ class UnbookmarkPage @Inject constructor(webInterface: WebInterface, loaders: Lo soneRequest.core.bookmarkedPosts .filterNot(Post::isLoaded) .forEach(soneRequest.core::unbookmarkPost) - throw RedirectException("bookmarks.html") + redirectTo("bookmarks.html") } soneRequest.isPOST -> { soneRequest.parameters["post", 36] ?.let(soneRequest.core::getPost) ?.also(soneRequest.core::unbookmarkPost) - throw RedirectException(soneRequest.parameters["returnPage", 256]) + redirectTo(soneRequest.parameters["returnPage", 256]) } } }