Allow viewing recipes on V1

This commit is contained in:
Kirill Kamakin
2022-10-29 16:40:19 +02:00
parent 90eeb155b2
commit 1f5234d123
15 changed files with 178 additions and 95 deletions

View File

@@ -6,6 +6,7 @@ import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientEntity
import gq.kirmanak.mealient.database.recipe.entity.RecipeInstructionEntity
import gq.kirmanak.mealient.database.recipe.entity.RecipeSummaryEntity
import gq.kirmanak.mealient.datasource.models.*
import gq.kirmanak.mealient.datasource.v1.models.GetRecipeSummaryResponseV1
import gq.kirmanak.mealient.datastore.recipe.AddRecipeDraft
fun GetRecipeResponse.toRecipeEntity() = RecipeEntity(
@@ -31,7 +32,7 @@ fun GetRecipeInstructionResponse.toRecipeInstructionEntity(remoteId: String) =
text = text
)
fun GetRecipeSummaryResponse.recipeEntity() = RecipeSummaryEntity(
fun GetRecipeSummaryResponseV1.recipeEntity() = RecipeSummaryEntity(
remoteId = remoteId,
name = name,
slug = slug,