mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-25 03:20:32 +00:00
Publish PostUpdated only when the post is published
This commit is contained in:
parent
a46b718937
commit
68d79bfa9c
1 changed files with 3 additions and 1 deletions
|
@ -89,7 +89,9 @@ impl Post {
|
||||||
diesel::update(self).set(self).execute(conn)?;
|
diesel::update(self).set(self).execute(conn)?;
|
||||||
let post = Self::get(conn, self.id)?;
|
let post = Self::get(conn, self.id)?;
|
||||||
// TODO: Call publish_published() when newly published
|
// TODO: Call publish_published() when newly published
|
||||||
|
if post.published {
|
||||||
self.publish_updated();
|
self.publish_updated();
|
||||||
|
}
|
||||||
Ok(post)
|
Ok(post)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue