diff --git a/crates/api_crud/src/post/update.rs b/crates/api_crud/src/post/update.rs index 651ddfdd4..3fa336376 100644 --- a/crates/api_crud/src/post/update.rs +++ b/crates/api_crud/src/post/update.rs @@ -111,10 +111,10 @@ pub async fn update_post( .await?; // cant schedule a post which is already published - let mut scheduled_publish_time = if orig_post.scheduled_publish_time.is_some() { - convert_published_time(data.scheduled_publish_time)?; + let scheduled_publish_time = if orig_post.scheduled_publish_time.is_some() { + Some(convert_published_time(data.scheduled_publish_time)?) } else { - None; + None }; let post_form = PostUpdateForm { @@ -125,7 +125,7 @@ pub async fn update_post( nsfw: data.nsfw, language_id: data.language_id, updated: Some(Some(naive_now())), - scheduled_publish_time: Some(scheduled_publish_time), + scheduled_publish_time, ..Default::default() };