mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 21:41:04 +00:00
add another async (and correctly convert followers_count)
This commit is contained in:
parent
cb1c260692
commit
0726375859
2 changed files with 5 additions and 2 deletions
|
@ -401,7 +401,7 @@ pub fn valid_slug(title: &str) -> Result<(), ValidationError> {
|
|||
}
|
||||
|
||||
#[post("/~/<blog_name>/new", data = "<form>")]
|
||||
pub fn create(
|
||||
pub async fn create(
|
||||
blog_name: String,
|
||||
form: LenientForm<NewPostForm>,
|
||||
cl: ContentLen,
|
||||
|
|
|
@ -277,7 +277,10 @@ pub async fn followers(
|
|||
let conn = &*rockets.conn;
|
||||
let page = page.unwrap_or_default();
|
||||
let user: User = User::find_by_fqn(&rockets, &name).await?;
|
||||
let followers_count = user.count_followers(&conn);
|
||||
let followers_count = match user.count_followers(&conn) {
|
||||
Ok(num) => num,
|
||||
Err(_) => 0,
|
||||
};
|
||||
|
||||
Ok(render!(users::followers(
|
||||
&rockets.to_context(),
|
||||
|
|
Loading…
Reference in a new issue