Categorize utilities

This commit is contained in:
spikecodes 2021-02-24 21:29:23 -08:00
parent 83ba0fb913
commit a3ec44149c
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
6 changed files with 260 additions and 263 deletions

View file

@ -25,7 +25,7 @@ pub async fn profile(req: Request<()>) -> tide::Result {
let username = req.param("name").unwrap_or("").to_string();
// Request user posts/comments from Reddit
let posts = fetch_posts(&path, "Comment".to_string()).await;
let posts = Post::fetch(&path, "Comment".to_string()).await;
match posts {
Ok((posts, after)) => {
@ -37,7 +37,7 @@ pub async fn profile(req: Request<()>) -> tide::Result {
posts,
sort: (sort, param(&path, "t")),
ends: (param(&path, "after"), after),
prefs: prefs(req),
prefs: Preferences::new(req),
})
}
// If there is an error show error page