Recipe edit (WIP): Buttons to add steps and inrgedients

This commit is contained in:
Greg Burri 2024-12-27 12:51:29 +01:00
parent 6876a254e1
commit d4962c98ff
9 changed files with 182 additions and 15 deletions

View file

@ -92,12 +92,42 @@ pub struct SetGroupComment {
pub comment: String,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct AddRecipeStep {
pub group_id: i64,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct AddRecipeStepResult {
pub step_id: i64,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct RemoveRecipeStep {
pub step_id: i64,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct SetStepAction {
pub step_id: i64,
pub action: String,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct AddRecipeIngredient {
pub step_id: i64,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct AddRecipeIngredientResult {
pub ingredient_id: i64,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct RemoveRecipeIngredient {
pub ingredient_id: i64,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct SetIngredientName {
pub ingredient_id: i64,
@ -142,7 +172,7 @@ pub struct Ingredient {
pub id: i64,
pub name: String,
pub comment: String,
pub quantity_value: f64,
pub quantity_value: Option<f64>,
pub quantity_unit: String,
}