Publish PostUpdated only when the post is published

pull/870/head
Kitaiti Makoto 3 years ago
parent a46b718937
commit 68d79bfa9c

@ -89,7 +89,9 @@ impl Post {
diesel::update(self).set(self).execute(conn)?;
let post = Self::get(conn, self.id)?;
// TODO: Call publish_published() when newly published
self.publish_updated();
if post.published {
self.publish_updated();
}
Ok(post)
}

Loading…
Cancel
Save