X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDeleteSonePage.kt;h=3f99730fc3eeeaf037916b3f0772cebd06f3d30e;hp=6cb7b44ea9d2ab35bdf60fe69e51c50960a5e17e;hb=HEAD;hpb=2e6be6f2fb6afede009dacc48b8e3318e30e5057 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt index 6cb7b44..3f99730 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteSonePage.kt @@ -15,15 +15,16 @@ import javax.inject.* */ @MenuName("DeleteSone") @TemplatePath("/templates/deleteSone.html") +@ToadletPath("deleteSone.html") class DeleteSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : - LoggedInPage("deleteSone.html", "Page.DeleteSone.Title", webInterface, loaders, templateRenderer) { + LoggedInPage("Page.DeleteSone.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { if (soneRequest.httpRequest.isPartSet("deleteSone")) { soneRequest.core.deleteSone(currentSone) } - throw RedirectException("index.html") + redirectTo("index.html") } }