Update TaglineInserForm and TaglineUpdateForm

pull/4580/head
Freek van Zee 2 months ago
parent 6935acba2f
commit 999e9845e7

@ -31,7 +31,9 @@ pub async fn create_tagline(
let content = process_markdown(&data.content, &slur_regex, &url_blocklist, &context).await?;
is_valid_tagline_content(&content)?;
let tagline_form = TaglineInsertForm { content };
let tagline_form = TaglineInsertForm {
content: Some(content),
};
let tagline = Tagline::create(&mut context.pool(), &tagline_form).await?;

@ -33,7 +33,7 @@ pub async fn update_tagline(
is_valid_tagline_content(&content)?;
let tagline_form = TaglineUpdateForm {
content,
content: Some(content),
updated: Some(Some(naive_now())),
};

@ -24,13 +24,13 @@ pub struct Tagline {
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
pub struct TaglineInsertForm {
pub content: String,
pub content: Option<String>,
}
#[derive(Clone, Default)]
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
pub struct TaglineUpdateForm {
pub content: String,
pub content: Option<String>,
pub updated: Option<Option<DateTime<Utc>>>,
}

Loading…
Cancel
Save