Decrease visibility of NewItem(Class)Form*

This commit is contained in:
Simon Bruder 2024-07-21 18:23:08 +02:00
parent f4202a1ed5
commit b7adf03dcc
Signed by: simon
GPG key ID: 347FF8699CDA0776
2 changed files with 22 additions and 22 deletions

View file

@ -24,24 +24,24 @@ fn default_quantity() -> usize {
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct NewItemForm { struct NewItemForm {
#[serde(default = "default_quantity")] #[serde(default = "default_quantity")]
pub quantity: usize, quantity: usize,
pub name: Option<String>, name: Option<String>,
pub parent: Option<Uuid>, parent: Option<Uuid>,
pub class: Uuid, class: Uuid,
pub original_packaging: Option<Uuid>, original_packaging: Option<Uuid>,
pub description: String, description: String,
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct NewItemFormPrefilled { struct NewItemFormPrefilled {
pub quantity: Option<usize>, quantity: Option<usize>,
pub name: Option<String>, name: Option<String>,
pub parent: Option<Uuid>, parent: Option<Uuid>,
pub class: Option<Uuid>, class: Option<Uuid>,
pub original_packaging: Option<Uuid>, original_packaging: Option<Uuid>,
pub description: Option<String>, description: Option<String>,
} }
#[get("/items/add")] #[get("/items/add")]

View file

@ -20,17 +20,17 @@ pub fn config(cfg: &mut web::ServiceConfig) {
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct NewItemClassForm { struct NewItemClassForm {
pub name: String, name: String,
pub parent: Option<Uuid>, parent: Option<Uuid>,
pub description: String, description: String,
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct NewItemClassFormPrefilled { struct NewItemClassFormPrefilled {
pub name: Option<String>, name: Option<String>,
pub parent: Option<Uuid>, parent: Option<Uuid>,
pub description: Option<String>, description: Option<String>,
} }
#[get("/item-classes/add")] #[get("/item-classes/add")]