Skip to content

Commit

Permalink
vinvoor: rename id to scan_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Dec 10, 2024
1 parent df1f41b commit 3c511df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vingo/src/routes/scans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub async fn add(state: State<AppState>, body: String) -> ResponseResult<String>

#[derive(Debug, FromQueryResult, Serialize)]
pub struct RecentScanItem {
id: i32,
scan_id: i32,
scan_time: DateTimeWithTimeZone,
}

Expand All @@ -118,7 +118,7 @@ pub async fn recent(state: State<AppState>) -> ResponseResult<Json<Vec<RecentSca
let scans = Scan::find()
.select_only()
.expr(Expr::cust(format!(
"DISTINCT ON ({}, DATE({})) scan.{}, scan.{}", //NOTE: this is a pain
"DISTINCT ON ({}, DATE({})) scan.{} AS scan_id, scan.{}", // NOTE: this is a pain // NOTE: Might as well keep everything in sql then
card::Column::UserId.as_str(),
scan::Column::ScanTime.as_str(),
scan::Column::Id.as_str(),
Expand Down

0 comments on commit 3c511df

Please sign in to comment.