mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-08 07:37:45 +00:00
Request about pages before posts
This commit is contained in:
parent
373ce55203
commit
078d6fe25b
2 changed files with 16 additions and 13 deletions
|
@ -24,12 +24,14 @@ pub async fn profile(req: HttpRequest) -> HttpResponse {
|
|||
let sort = param(&path, "sort");
|
||||
let username = req.match_info().get("username").unwrap_or("").to_string();
|
||||
|
||||
// Request user profile data and user posts/comments from Reddit
|
||||
let user = user(&username).await.unwrap_or_default();
|
||||
// Request user posts/comments from Reddit
|
||||
let posts = fetch_posts(&path, "Comment".to_string()).await;
|
||||
|
||||
match posts {
|
||||
Ok((posts, after)) => {
|
||||
// If you can get user posts, also request user data
|
||||
let user = user(&username).await.unwrap_or_default();
|
||||
|
||||
let s = UserTemplate {
|
||||
user,
|
||||
posts,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue