RecipeApiService

Interface for the RecipeApiService. It contains the methods for managing Recipe data in the API.

Functions

Link copied to clipboard
@DELETE(value = "recipes/{id}")
abstract suspend fun deleteRecipe(@Path(value = "id") id: String): ApiRecipe

Deletes a Recipe item from the API.

Link copied to clipboard

Extension function to convert the deleteRecipe function to a Flow.

Link copied to clipboard
@GET(value = "recipes")
abstract suspend fun getRecipes(): List<ApiRecipe>

Fetches all Recipe items from the API.

Link copied to clipboard

Extension function to convert the getRecipes function to a Flow.

Link copied to clipboard
@POST(value = "recipes")
abstract suspend fun postRecipe(@Body recipe: ApiRecipe): ApiRecipe

Posts a new Recipe item to the API.

Link copied to clipboard

Extension function to convert the postRecipe function to a Flow.

Link copied to clipboard
@PUT(value = "recipes/{id}")
abstract suspend fun putRecipe(@Path(value = "id") id: String, @Body recipe: ApiRecipe): ApiRecipe

Updates a Recipe item in the API.

Link copied to clipboard

Extension function to convert the putRecipe function to a Flow.