Skip to main content

validate

Function validate 

Source
pub async fn validate(
    db: &Db,
    table: &str,
    id_field: &str,
    fields: &[FieldRules],
    data: &HashMap<String, String>,
    mode: Mode,
    edited_id: Option<&str>,
) -> CoreResult<ErrorBag>
Expand description

Runs validate_fields, then the DB-backed Rule::Unique probe for each field that carries it, has a value, and passed its cheap rules. edited_id is the row being updated (ignored by the probe); pass None on create.