Refresh favorite recipes on change

This commit is contained in:
Kirill Kamakin
2022-12-13 20:53:45 +01:00
parent af390ebcaf
commit 97735847c0
5 changed files with 23 additions and 0 deletions

View File

@@ -40,4 +40,10 @@ interface RecipeDao {
@Query("DELETE FROM recipe_instruction WHERE recipe_id = :recipeId")
suspend fun deleteRecipeInstructions(recipeId: String)
@Query("UPDATE recipe_summaries SET is_favorite = 1 WHERE slug IN (:favorites)")
suspend fun setFavorite(favorites: List<String>)
@Query("UPDATE recipe_summaries SET is_favorite = 0 WHERE slug NOT IN (:favorites)")
suspend fun setNonFavorite(favorites: List<String>)
}