add comments to note on unlisted notes
parent
b337306799
commit
c68263a7bd
|
@ -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> {
|
||||
store::get_obj(&Self::uuid_to_post_key(uuid)).await
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue