import net.pterodactylus.sone.utils.parameters
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.web.page.FreenetRequest
import net.pterodactylus.sone.utils.parameters
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.web.page.FreenetRequest
* @see net.pterodactylus.sone.data.Profile#moveFieldUp(Field)
* @see net.pterodactylus.sone.data.Profile#moveFieldDown(Field)
*/
* @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 ->
override fun createJsonObject(currentSone: Sone, request: FreenetRequest) =
currentSone.profile.let { profile ->
createSuccessJsonObject()
} ?: createErrorJsonObject("invalid-direction")
} catch (e: IllegalArgumentException) {
createSuccessJsonObject()
} ?: createErrorJsonObject("invalid-direction")
} catch (e: IllegalArgumentException) {