Current recipe id was not set

This commit is contained in:
Greg Burri 2025-04-21 19:37:09 +02:00
parent 812ba9dc3b
commit 9dccd553bc
5 changed files with 28 additions and 12 deletions

View file

@ -8,9 +8,9 @@ use crate::{
};
pub struct Recipes {
pub public: Vec<(i64, String)>,
pub private: Vec<(i64, String)>,
pub current_id: Option<i64>,
public: Vec<(i64, String)>,
private: Vec<(i64, String)>,
current_id: Option<i64>,
}
impl Recipes {
@ -18,6 +18,7 @@ impl Recipes {
connection: db::Connection,
user: &Option<model::User>,
lang: &str,
current_id: Option<i64>,
) -> Result<Self, db::DBError> {
Ok(Recipes {
public: connection
@ -28,7 +29,7 @@ impl Recipes {
} else {
vec![]
},
current_id: None,
current_id,
})
}