mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 10:35:39 +00:00
feat: migrate fetching stats to use db_*
This commit is contained in:
@@ -19,7 +19,6 @@ use actix_web::{web, HttpResponse, Responder};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::errors::*;
|
||||
use crate::stats::fetch::{Stats, StatsUnixTimestamp};
|
||||
use crate::AppData;
|
||||
|
||||
pub mod routes {
|
||||
@@ -50,7 +49,6 @@ pub async fn get(
|
||||
id: Identity,
|
||||
) -> ServiceResult<impl Responder> {
|
||||
let username = id.identity().unwrap();
|
||||
let stats = Stats::new(&username, &payload.key, &data.db).await?;
|
||||
let stats = StatsUnixTimestamp::from_stats(&stats);
|
||||
let stats = data.stats.fetch(&data, &username, &payload.key).await?;
|
||||
Ok(HttpResponse::Ok().json(&stats))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user