app,server: Display rating in recipe

This commit is contained in:
traxys 2023-06-26 12:06:08 +02:00
parent 1ea5c8aafa
commit 5ef000dec0
3 changed files with 28 additions and 8 deletions

View file

@ -76,7 +76,7 @@ pub(super) async fn list_recipes(
.all(&state.db)
.await?
.into_iter()
.map(|r| (r.id, r.name))
.map(|r| (r.id, r.name, r.ranking as _))
.collect(),
}
.into())
@ -144,6 +144,7 @@ pub(super) async fn fetch_recipe(
Ok(RecipeInfo {
name: recipe.name,
steps: recipe.steps,
rating: recipe.ranking as _,
ingredients,
}
.into())