🔀 Merge branch 'release/v82'
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / FollowSonePage.kt
index 2375278..5fd06ce 100644 (file)
@@ -11,8 +11,9 @@ import javax.inject.*
 /**
  * This page lets the user follow another Sone.
  */
+@ToadletPath("followSone.html")
 class FollowSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
-               LoggedInPage("followSone.html", "Page.FollowSone.Title", webInterface, loaders, 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))
                }
        }