Set user language to new recipe + cleaning
This commit is contained in:
parent
8b4b788562
commit
03ebbb74fa
12 changed files with 73 additions and 86 deletions
|
|
@ -25,7 +25,9 @@ pub async fn recipes_list_fragments(
|
|||
Extension(tr): Extension<translation::Tr>,
|
||||
) -> Result<impl IntoResponse> {
|
||||
let recipes = Recipes {
|
||||
published: connection.get_all_published_recipe_titles().await?,
|
||||
published: connection
|
||||
.get_all_published_recipe_titles(tr.current_lang_code(), user.as_ref().map(|u| u.id))
|
||||
.await?,
|
||||
unpublished: if let Some(user) = user.as_ref() {
|
||||
connection
|
||||
.get_all_unpublished_recipe_titles(user.id)
|
||||
|
|
@ -35,5 +37,5 @@ pub async fn recipes_list_fragments(
|
|||
},
|
||||
current_id: current_recipe.current_recipe_id,
|
||||
};
|
||||
Ok(RecipesListFragmentTemplate { user, tr, recipes })
|
||||
Ok(RecipesListFragmentTemplate { tr, recipes })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue