Update Tachidesk

This commit is contained in:
Syer10
2021-08-29 13:26:57 -04:00
parent 4f7010931c
commit bbda1ca66a
4 changed files with 7 additions and 8 deletions

View File

@@ -3,9 +3,9 @@ import org.gradle.api.JavaVersion
object Config {
const val tachideskVersion = "v0.4.7"
// Bump this when updating the Tachidesk version or Preview commit
const val serverCode = 809
const val serverCode = 842
const val preview = true
const val previewCommit = "b31f2d50f6ed03aa900986536d90b4aa9a9417d4"
const val previewCommit = "a8ef6cdd4f10eaf0d265fc8a422fdd9bc4a28cfd"
val jvmTarget = JavaVersion.VERSION_15
}

View File

@@ -95,9 +95,9 @@ class CategoryInteractionHandler @Inject constructor(
}
suspend fun modifyCategory(category: Category, name: String? = null, isLanding: Boolean? = null) = modifyCategory(category.id, name, isLanding)
suspend fun reorderCategory(categoryId: Long, to: Int, from: Int) = withIOContext {
suspend fun reorderCategory(to: Int, from: Int) = withIOContext {
client.submitForm<HttpResponse>(
serverUrl + categoryReorderRequest(categoryId),
serverUrl + categoryReorderRequest(),
formParameters = Parameters.build {
append("to", to.toString())
append("from", from.toString())
@@ -106,7 +106,6 @@ class CategoryInteractionHandler @Inject constructor(
method = HttpMethod.Patch
}
}
suspend fun reorderCategory(category: Category, to: Int, from: Int) = reorderCategory(category.id, to, from)
suspend fun deleteCategory(categoryId: Long) = withIOContext {
client.delete<HttpResponse>(

View File

@@ -34,8 +34,8 @@ fun categoryModifyRequest(categoryId: Long) =
"/api/v1/category/$categoryId"
@Patch
fun categoryReorderRequest(categoryId: Long) =
"/api/v1/category/$categoryId/reorder"
fun categoryReorderRequest() =
"/api/v1/category/reorder"
@Delete
fun categoryDeleteRequest(categoryId: Long) =

View File

@@ -66,7 +66,7 @@ class CategoriesMenuViewModel @Inject constructor(
val updatedCategory = updatedCategories.find { it.id == category.id || it.name == category.name } ?: return@forEach
if (category.order != updatedCategory.order) {
debug { "${category.name}: ${updatedCategory.order} to ${category.order}" }
categoryHandler.reorderCategory(updatedCategory, category.order, updatedCategory.order)
categoryHandler.reorderCategory(category.order, updatedCategory.order)
}
updatedCategories = categoryHandler.getCategories(true)
}