♻️ Move throwing redirect exception into method
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / UnfollowSonePage.kt
index 79fdef5..9dbe9f1 100644 (file)
@@ -19,7 +19,7 @@ class UnfollowSonePage @Inject constructor(webInterface: WebInterface, loaders:
                if (soneRequest.isPOST) {
                        soneRequest.parameters["sone"]!!.split(Regex("[ ,]+"))
                                        .forEach { soneRequest.core.unfollowSone(currentSone, it) }
-                       throw RedirectException(soneRequest.parameters["returnPage", 256])
+                       redirectTo(soneRequest.parameters["returnPage", 256])
                }
        }