X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FUnlikePage.kt;h=46bd3abd85e68bccaa95d6c93030a0b6e2a4a840;hp=85d76462cc90ccfd5584ce25dc23f32414771492;hb=faf66247a34f64946990a985d2ea3003465969cb;hpb=a76956e389fcfe6282ad4ca7156bbf76327bb0c0 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlikePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlikePage.kt index 85d7646..46bd3ab 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlikePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlikePage.kt @@ -11,8 +11,9 @@ import javax.inject.* /** * Page that lets the user unlike a [net.pterodactylus.sone.data.Post] or [net.pterodactylus.sone.data.Reply]. */ -class UnlikePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): - LoggedInPage("unlike.html", "Page.Unlike.Title", webInterface, loaders, templateRenderer) { +@ToadletPath("unlike.html") +class UnlikePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : + LoggedInPage("Page.Unlike.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { @@ -20,7 +21,7 @@ class UnlikePage @Inject constructor(webInterface: WebInterface, loaders: Loader "post" -> currentSone.removeLikedPostId(soneRequest.parameters["post"]!!) "reply" -> currentSone.removeLikedReplyId(soneRequest.parameters["reply"]!!) } - throw RedirectException(soneRequest.parameters["returnPage", 256]) + redirectTo(soneRequest.parameters["returnPage", 256]) } }