idk
This commit is contained in:
parent
43abe4300f
commit
70d45e42a8
1 changed files with 2 additions and 1 deletions
|
@ -198,7 +198,8 @@ impl Track {
|
|||
///
|
||||
/// A vector of `Track` objects representing the latest tracks for the given user.
|
||||
pub async fn get_latest_of_user(u: &User) -> Vec<Self> {
|
||||
let res: Vec<(uuid::Uuid, String, String, chrono::DateTime<chrono::Utc>, Option<uuid::Uuid>, Option<uuid::Uuid>, Option<serde_json::Value>, chrono::DateTime<chrono::Utc>)> = sqlx::query_as("SELECT DISTINCT(t.*), e.time FROM track t JOIN events e ON t.id = e.track WHERE e.user = $1 ORDER BY e.time DESC")
|
||||
// todo : weird
|
||||
let res: Vec<(uuid::Uuid, String, String, chrono::DateTime<chrono::Utc>, Option<uuid::Uuid>, Option<uuid::Uuid>, Option<serde_json::Value>, chrono::DateTime<chrono::Utc>)> = sqlx::query_as("SELECT DISTINCT(t.*), e.time FROM track t JOIN events e ON t.id = e.track WHERE e.user = $1 ORDER BY e.time DESC LIMIT 300")
|
||||
.bind(&u.username)
|
||||
.fetch_all(get_pg!())
|
||||
.await
|
||||
|
|
Loading…
Reference in a new issue