in app/data/Recipes.scala [115:129]
def findById(id: RecipeId)(implicit dynamo: Dynamo): Option[Recipe] = {
val dbModel: Option[DbModel] =
table.get("id" === id).exec().flatMap { attempt =>
attempt match {
case Right(dbModel) => Some(dbModel)
case Left(_) => None
}
}
for {
dbModel <- dbModel
baseImage <- BaseImages.findById(dbModel.baseImageId)
} yield {
Recipe.db2domain(dbModel, baseImage)
}
}