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
|
|
@ -65,6 +65,57 @@ pub struct SetIsPublished {
|
|||
pub is_published: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeGroup {
|
||||
pub recipe_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeGroupResult {
|
||||
pub group_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct RemoveRecipeGroup {
|
||||
pub group_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct SetGroupName {
|
||||
pub group_id: i64,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct SetGroupComment {
|
||||
pub group_id: i64,
|
||||
pub comment: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct Group {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub comment: String,
|
||||
pub steps: Vec<Step>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct Step {
|
||||
pub id: i64,
|
||||
pub action: String,
|
||||
pub ingredients: Vec<Ingredient>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct Ingredient {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub comment: String,
|
||||
pub quantity_value: f64,
|
||||
pub quantity_unit: String,
|
||||
}
|
||||
|
||||
// #[derive(Serialize, Deserialize, Clone)]
|
||||
// pub struct AddRecipeImage {
|
||||
// pub recipe_id: i64,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue