Implement deletion of shopping list items (#163)
* Disable unstable Gradle features * Implement deletion of shopping list items * Hide deleted items even before they're deleted * Check/uncheck items locally while the BE is updated
This commit is contained in:
@@ -64,4 +64,6 @@ interface MealieDataSourceV1 {
|
||||
suspend fun getShoppingList(id: String): GetShoppingListResponseV1
|
||||
|
||||
suspend fun updateIsShoppingListItemChecked(id: String, isChecked: Boolean)
|
||||
|
||||
suspend fun deleteShoppingListItem(id: String)
|
||||
}
|
||||
@@ -188,4 +188,12 @@ class MealieDataSourceV1Impl @Inject constructor(
|
||||
}
|
||||
updateShoppingListItem(id, JsonObject(updatedItem))
|
||||
}
|
||||
|
||||
override suspend fun deleteShoppingListItem(
|
||||
id: String,
|
||||
) = networkRequestWrapper.makeCallAndHandleUnauthorized(
|
||||
block = { service.deleteShoppingListItem(id) },
|
||||
logMethod = { "deleteShoppingListItem" },
|
||||
logParameters = { "id = $id" }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -89,4 +89,9 @@ interface MealieServiceV1 {
|
||||
@Path("id") id: String,
|
||||
@Body request: JsonElement,
|
||||
)
|
||||
|
||||
@DELETE("/api/groups/shopping/items/{id}")
|
||||
suspend fun deleteShoppingListItem(
|
||||
@Path("id") id: String,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user