Skip to content

Commit

Permalink
Fix typo when giving field name
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed Sep 24, 2024
1 parent e9daf19 commit d9ad7a9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ edgedb-derive = "0.5.2"
edgedb-errors = { version = "0.4.2", features = ["miette"] }
edgedb-protocol = { version = "0.6.1", features = ["all-types"] }
edgedb-tokio = { version = "0.5.1", features = ["serde_json", "miette-errors"] }
field_access = "0.1.9"
field_names = "0.2.0"
fluent-bundle = "0.15.3"
fluent-templates = "0.10.1"
Expand Down
5 changes: 3 additions & 2 deletions src/api/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::num::NonZeroU16;
use edgedb_protocol::named_args;
use edgedb_protocol::value::Value as EValue;
use edgedb_protocol::value_opt::ValueOpt;
use field_access::FieldAccess;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use validify::Validify;
Expand Down Expand Up @@ -132,7 +133,7 @@ impl BlogPostPatchData {
}
}

#[derive(Debug, Default, Deserialize, Validify)]
#[derive(Debug, Default, Deserialize, FieldAccess, Validify)]
pub struct BlogPostCreateData {
#[validate(length(min = 2))]
pub title: String,
Expand Down Expand Up @@ -185,7 +186,7 @@ impl BlogPostCreateData {
let html = self.body.as_ref().map(|v| markdown_to_html(v));
let excerpt = self.body.as_ref().map(|v| make_excerpt(v));
hm.insert("html", html.into());
hm.insert("excerpt ", excerpt.into());
hm.insert("excerpt", excerpt.into());
}
if submitted_fields.contains("format") {
hm.insert("format", self.format.clone().into());
Expand Down

0 comments on commit d9ad7a9

Please sign in to comment.