diff options
Diffstat (limited to 'server/src/ui/stats.rs')
| -rw-r--r-- | server/src/ui/stats.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/server/src/ui/stats.rs b/server/src/ui/stats.rs index fc4ae64..387ca63 100644 --- a/server/src/ui/stats.rs +++ b/server/src/ui/stats.rs @@ -3,22 +3,10 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin <metamuffin.org> */ -use super::error::MyError; -use crate::request_info::RequestInfo; -use rocket::{Either, get, response::content::RawHtml, serde::json::Json}; +use crate::{request_info::RequestInfo, ui::error::MyResult}; +use rocket::{get, response::content::RawHtml}; #[get("/stats")] -pub fn r_stats( - ri: RequestInfo, -) -> Result<Either<RawHtml<String>, Json<ApiStatsResponse>>, MyError> { - let r = stats(&ri.session)?; - - Ok(if ri.accept.is_json() { - Either::Right(Json(r)) - } else { - Either::Left(RawHtml(render_page( - &StatsPage { lang: &ri.lang, r }, - ri.render_info(), - ))) - }) +pub fn r_stats(ri: RequestInfo) -> MyResult<RawHtml<String>> { + todo!() } |