mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-05-20 02:38:05 +00:00
Update TaglineInserForm and TaglineUpdateForm
This commit is contained in:
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…
Reference in a new issue