Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vinvoor/recent scans #118

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vingo/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rust 1.80.1
rust 1.81.0
2 changes: 1 addition & 1 deletion vingo/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.80.1-alpine3.19
FROM rust:1.81-alpine3.20

WORKDIR /backend

Expand Down
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
Loading