Don't modify article title for slug

This commit is contained in:
Kitaiti Makoto
2021-04-10 16:32:58 +09:00
parent 87457c0ed1
commit 6345a57498
3 changed files with 8 additions and 11 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
use chrono::NaiveDateTime;
use heck::KebabCase;
use rocket_contrib::json::Json;
use crate::api::{authorization::*, Api};
@@ -109,7 +108,7 @@ pub fn create(
let author = User::get(&conn, auth.0.user_id)?;
let slug = &payload.title.clone().to_kebab_case();
let slug = Post::slug(&payload.title);
let date = payload.creation_date.clone().and_then(|d| {
NaiveDateTime::parse_from_str(format!("{} 00:00:00", d).as_ref(), "%Y-%m-%d %H:%M:%S").ok()
});