mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-14 14:02:50 +00:00
Rewrite URL Dispatch
This commit is contained in:
parent
148d87fb45
commit
75bc170eba
7 changed files with 28 additions and 32 deletions
|
@ -1,6 +1,6 @@
|
|||
// CRATES
|
||||
use crate::utils::{fetch_posts, format_num, format_url, request, val, ErrorTemplate, Params, Post, Subreddit};
|
||||
use actix_web::{get, http::StatusCode, web, HttpResponse, Result};
|
||||
use actix_web::{http::StatusCode, web, HttpResponse, Result};
|
||||
use askama::Template;
|
||||
use std::convert::TryInto;
|
||||
|
||||
|
@ -16,8 +16,7 @@ struct SubredditTemplate {
|
|||
|
||||
// SERVICES
|
||||
#[allow(dead_code)]
|
||||
#[get("/r/{sub}")]
|
||||
async fn page(web::Path(sub): web::Path<String>, params: web::Query<Params>) -> Result<HttpResponse> {
|
||||
pub async fn page(web::Path(sub): web::Path<String>, params: web::Query<Params>) -> Result<HttpResponse> {
|
||||
render(sub, params.sort.clone(), (params.before.clone(), params.after.clone())).await
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue