mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 19:41:03 +00:00
Update Post.ap_url when published
This commit is contained in:
parent
2bc4a13964
commit
2ffd357d95
1 changed files with 7 additions and 0 deletions
|
@ -290,6 +290,13 @@ 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
|
||||
));
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
|
Loading…
Reference in a new issue