Extract Post::ap_url()

This commit is contained in:
Kitaiti Makoto
2021-04-09 10:55:09 +09:00
parent a419ef5319
commit 7b2bab0f9d
2 changed files with 6 additions and 13 deletions
+1 -7
View File
@@ -290,13 +290,7 @@ pub fn update(
let newly_published = if !post.published && !form.draft {
post.published = true;
post.creation_date = Utc::now().naive_utc();
// TODO: share code with Post::insert()
post.ap_url = plume_models::ap_url(&format!(
"{}/~/{}/{}/",
CONFIG.base_url,
post.get_blog(&conn).unwrap().fqn,
new_slug
));
post.ap_url = Post::ap_url(post.get_blog(&conn).unwrap(), &new_slug);
true
} else {
false