import net.pterodactylus.sone.utils.parameters
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.web.page.FreenetRequest
+import javax.inject.Inject
/**
* AJAX page that lets the user move a profile field up or down.
* @see net.pterodactylus.sone.data.Profile#moveFieldUp(Field)
* @see net.pterodactylus.sone.data.Profile#moveFieldDown(Field)
*/
-class MoveProfileFieldAjaxPage(webInterface: WebInterface) : LoggedInJsonPage("moveProfileField.ajax", webInterface) {
+class MoveProfileFieldAjaxPage @Inject constructor(webInterface: WebInterface) :
+ LoggedInJsonPage("moveProfileField.ajax", webInterface) {
override fun createJsonObject(currentSone: Sone, request: FreenetRequest) =
currentSone.profile.let { profile ->
else -> null
}?.let {
currentSone.profile = profile
- webInterface.core.touchConfiguration()
+ core.touchConfiguration()
createSuccessJsonObject()
} ?: createErrorJsonObject("invalid-direction")
} catch (e: IllegalArgumentException) {