Skip to content

Commit 79feb78

Browse files
committed
vinvoor: rename id to scan_id
1 parent aa64f42 commit 79feb78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vingo/src/routes/scans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub async fn add(state: State<AppState>, body: String) -> ResponseResult<String>
109109

110110
#[derive(Debug, FromQueryResult, Serialize)]
111111
pub struct RecentScanItem {
112-
id: i32,
112+
scan_id: i32,
113113
scan_time: DateTimeWithTimeZone,
114114
}
115115

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

0 commit comments

Comments
 (0)