mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-14 05:52:53 +00:00
Make a request() utility
This commit is contained in:
parent
f455e2095d
commit
0054557c86
8 changed files with 105 additions and 64 deletions
|
@ -20,7 +20,7 @@ struct PopularTemplate {
|
|||
|
||||
// RENDER
|
||||
async fn render(sub_name: String, sort: String) -> Result<HttpResponse> {
|
||||
let posts: Vec<Post> = posts(sub_name, &sort).await;
|
||||
let posts: Vec<Post> = posts(sub_name, &sort).await?;
|
||||
|
||||
let s = PopularTemplate { posts: posts, sort: sort }.render().unwrap();
|
||||
Ok(HttpResponse::Ok().content_type("text/html").body(s))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue