diff --git a/cooked/src/routes.rs b/cooked/src/routes.rs index a8c9e4a..7fbc200 100644 --- a/cooked/src/routes.rs +++ b/cooked/src/routes.rs @@ -10,7 +10,6 @@ use actix_web::HttpMessage; use actix_web::{get, post, HttpRequest, HttpResponse, Responder}; use askama::Template; use askama_actix::TemplateToResponse; -use itertools::Itertools; use sea_orm::{ prelude::*, DatabaseTransaction, JoinType, QueryOrder, QuerySelect, TransactionTrait, }; @@ -499,6 +498,7 @@ async fn save_recipe(form: RecipeForm, t: &mut DatabaseTransaction) -> Result>(); tracing::debug!("Known tag names: {known:?}"); + let mut missing = Vec::with_capacity(text_tags.len()); for tag_name in text_tags .into_iter() @@ -651,7 +651,7 @@ async fn edit_recipe( { Ok(Some(recipe)) => recipe, Ok(_) => todo!("index & not found"), - Err(err) => { + Err(_err) => { todo!() } }; @@ -723,7 +723,7 @@ async fn edit_recipe( "{} {} {}", ingredient.qty, ingredient.unit, - ingredients.get(&ingredient.id)?.name + ingredients.get(&ingredient.ingredient_id)?.name )) }) .collect::>() @@ -804,6 +804,7 @@ async fn tmp_cleanup() { let d = tokio::time::Duration::from_secs(10); loop { tokio::time::sleep(d).await; + let _ = std::fs::create_dir_all("/tmp/assets/recipies/images"); // tracing::info!("Starting files cleanup"); let Ok(mut dir) = tokio::fs::read_dir("/tmp/assets/recipies/images").await else { diff --git a/cooked/templates/recipies/update_form.jinja b/cooked/templates/recipies/update_form.jinja index 70bbf6f..cea73b8 100644 --- a/cooked/templates/recipies/update_form.jinja +++ b/cooked/templates/recipies/update_form.jinja @@ -78,7 +78,7 @@
{% for tag in known_tags %}