Recipe edit (WIP): forms to edit groups, steps and ingredients
This commit is contained in:
parent
dd05a673d9
commit
07b7ff425e
25 changed files with 881 additions and 203 deletions
|
|
@ -34,20 +34,30 @@ pub struct Recipe {
|
|||
// pub groups: Vec<Group>,
|
||||
}
|
||||
|
||||
#[derive(FromRow)]
|
||||
pub struct Group {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub comment: String,
|
||||
|
||||
#[sqlx(skip)]
|
||||
pub steps: Vec<Step>,
|
||||
}
|
||||
|
||||
#[derive(FromRow)]
|
||||
pub struct Step {
|
||||
pub id: i64,
|
||||
pub action: String,
|
||||
|
||||
#[sqlx(skip)]
|
||||
pub ingredients: Vec<Ingredient>,
|
||||
}
|
||||
|
||||
#[derive(FromRow)]
|
||||
pub struct Ingredient {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub comment: String,
|
||||
pub quantity: i32,
|
||||
pub quantity_value: f64,
|
||||
pub quantity_unit: String,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue