More Replies Button

This commit is contained in:
spikecodes 2020-12-21 17:17:40 -08:00
parent 4b7cbb3de2
commit 11cfbdc3ed
11 changed files with 40 additions and 21 deletions

View file

@ -14,7 +14,7 @@ struct UserTemplate {
async fn render(username: String, sort: String) -> Result<HttpResponse> {
// Build the Reddit JSON API url
let url: String = format!("https://www.reddit.com/user/{}/.json?sort={}", username, sort);
let url: String = format!("user/{}/.json?sort={}", username, sort);
let user = user(&username).await;
let posts = fetch_posts(url, "Comment".to_string()).await;
@ -49,7 +49,7 @@ pub async fn page(web::Path(username): web::Path<String>, params: web::Query<Par
// USER
async fn user(name: &String) -> Result<User, &'static str> {
// Build the Reddit JSON API url
let url: String = format!("https://www.reddit.com/user/{}/about.json", name);
let url: String = format!("user/{}/about.json", name);
// Send a request to the url, receive JSON in response
let req = request(url).await;