Initialize recipe removal feature
This commit is contained in:
@@ -46,4 +46,6 @@ interface MealieDataSourceV0 {
|
||||
suspend fun removeFavoriteRecipe(userId: Int, recipeSlug: String)
|
||||
|
||||
suspend fun addFavoriteRecipe(userId: Int, recipeSlug: String)
|
||||
|
||||
suspend fun deleteRecipe(slug: String)
|
||||
}
|
||||
@@ -115,4 +115,12 @@ class MealieDataSourceV0Impl @Inject constructor(
|
||||
logMethod = { "addFavoriteRecipe" },
|
||||
logParameters = { "userId = $userId, recipeSlug = $recipeSlug" }
|
||||
)
|
||||
|
||||
override suspend fun deleteRecipe(
|
||||
slug: String
|
||||
): Unit = networkRequestWrapper.makeCallAndHandleUnauthorized(
|
||||
block = { service.deleteRecipe(slug) },
|
||||
logMethod = { "deleteRecipe" },
|
||||
logParameters = { "slug = $slug" }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -55,4 +55,9 @@ interface MealieServiceV0 {
|
||||
@Path("userId") userId: Int,
|
||||
@Path("recipeSlug") recipeSlug: String
|
||||
)
|
||||
|
||||
@DELETE("/api/recipes/{slug}")
|
||||
suspend fun deleteRecipe(
|
||||
@Path("slug") slug: String
|
||||
)
|
||||
}
|
||||
@@ -54,4 +54,5 @@ interface MealieDataSourceV1 {
|
||||
suspend fun removeFavoriteRecipe(userId: String, recipeSlug: String)
|
||||
|
||||
suspend fun addFavoriteRecipe(userId: String, recipeSlug: String)
|
||||
suspend fun deleteRecipe(slug: String)
|
||||
}
|
||||
@@ -126,5 +126,13 @@ class MealieDataSourceV1Impl @Inject constructor(
|
||||
logMethod = { "addFavoriteRecipe" },
|
||||
logParameters = { "userId = $userId, recipeSlug = $recipeSlug" }
|
||||
)
|
||||
|
||||
override suspend fun deleteRecipe(
|
||||
slug: String
|
||||
): Unit = networkRequestWrapper.makeCallAndHandleUnauthorized(
|
||||
block = { service.deleteRecipe(slug) },
|
||||
logMethod = { "deleteRecipe" },
|
||||
logParameters = { "slug = $slug" }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -61,4 +61,9 @@ interface MealieServiceV1 {
|
||||
@Path("userId") userId: String,
|
||||
@Path("recipeSlug") recipeSlug: String
|
||||
)
|
||||
|
||||
@DELETE("/api/recipes/{slug}")
|
||||
suspend fun deleteRecipe(
|
||||
@Path("slug") slug: String
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user