add comments to note on unlisted notes

Peter Cai 3 years ago
parent b337306799
commit c68263a7bd
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F

@ -84,6 +84,8 @@ impl Post {
// post is not found in PostsList, it must not be found
// here either; if a post is found in PostsList, then
// this method should not return any error.
// (except for hidden posts, in which case they won't be
// present in PostsList)
pub async fn find_by_uuid(uuid: &str) -> MyResult<Post> {

@ -34,6 +34,7 @@ async fn get_actions(_req: Request, url: Url) -> MyResult<Response> {
// Show different options depending on whether the post already exists
// Use Post here because PostsList is larger to read into memory
// also slower to check one-by-one
// (also, because it may be a hidden post that does not live in PostsList)
let post = match params.get("item_uuid") {
Some(uuid) => match blog::Post::find_by_uuid(&uuid).await {
Ok(post) => Some(post),