X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FFollowSonePage.kt;h=5fd06ceec626da93be58973c731e95f0d05a1c3b;hp=10be225391b773da14cbe30a8d40b3a433ed2b98;hb=aaf780d3c2a6f5ce47295786f3963c8b93f6a145;hpb=a76956e389fcfe6282ad4ca7156bbf76327bb0c0 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/FollowSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/FollowSonePage.kt index 10be225..5fd06ce 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/FollowSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/FollowSonePage.kt @@ -11,8 +11,9 @@ import javax.inject.* /** * This page lets the user follow another Sone. */ -class FollowSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): - LoggedInPage("followSone.html", "Page.FollowSone.Title", webInterface, loaders, templateRenderer) { +@ToadletPath("followSone.html") +class FollowSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : + LoggedInPage("Page.FollowSone.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { @@ -23,7 +24,7 @@ class FollowSonePage @Inject constructor(webInterface: WebInterface, loaders: Lo soneRequest.core.followSone(currentSone, sone.first) soneRequest.core.markSoneKnown(sone.second) } - throw RedirectException(soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)) + redirectTo(soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)) } }