mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2026-01-24 12:34:04 +01:00
Update Tachidesk
This commit is contained in:
@@ -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>(
|
||||
|
||||
@@ -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) =
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user