34 lines
655 B
Rust

use askama::Template;
use garde::Validate;
use serde::Deserialize;
use crate::models::Clothing;
use crate::filters;
pub mod delete;
pub mod get_edit;
pub mod get_new;
pub mod get_overview;
pub mod get_read;
pub mod post_edit;
pub mod post_new;
#[derive(Template)]
#[template(path = "clothing/clothing_entry_edit.html")]
struct EditClothingPartialTemplate {
id: Option<i32>,
name: Option<String>,
}
#[derive(Template)]
#[template(path = "clothing/clothing_entry_read.html")]
struct ReadClothingPartialTemplate {
c: Clothing,
}
#[derive(Deserialize, Validate)]
struct NewOrEditClothingForm {
#[garde(length(min=3))]
name: String,
}