fake personal history

This commit is contained in:
2023-10-01 14:35:04 +02:00
parent 8a75ba4335
commit af81920a47
3 changed files with 34 additions and 5 deletions

View File

@ -1,3 +1,4 @@
use crate::model::user::User;
use serde::Serialize;
use sqlx::{FromRow, Row, SqlitePool};
@ -41,3 +42,26 @@ ORDER BY rowed_km DESC;
.collect()
}
}
#[derive(Debug, Serialize)]
pub struct PersonalStat {
date: String,
km: i32,
}
pub async fn get_personal(db: &SqlitePool, user: &User) -> Vec<PersonalStat> {
vec![
PersonalStat {
date: String::from("2023-01-01"),
km: 5,
},
PersonalStat {
date: String::from("2023-02-01"),
km: 24,
},
PersonalStat {
date: String::from("2023-08-30"),
km: 1340,
},
]
}