From cba59549cac7b974b6585d090dd0d93b848394e7 Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Sat, 15 Feb 2025 15:14:22 +0100 Subject: [PATCH] fix graph types for postgres endpoint --- backend/src/api/models/input.rs | 6 +++--- backend/src/api/stats.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/api/models/input.rs b/backend/src/api/models/input.rs index 0346478..a6e400c 100644 --- a/backend/src/api/models/input.rs +++ b/backend/src/api/models/input.rs @@ -80,9 +80,9 @@ pub struct ListStats { #[derive(FromQueryResult, Deserialize, ToSchema, Serialize)] pub struct GraphDataPoint { - pub month: u8, - pub year: u16, - pub count: u32, + pub month: i32, + pub year: i32, + pub count: i32, } #[derive(FromQueryResult, Deserialize, ToSchema, Serialize)] diff --git a/backend/src/api/stats.rs b/backend/src/api/stats.rs index 1cda726..d7bbe54 100644 --- a/backend/src/api/stats.rs +++ b/backend/src/api/stats.rs @@ -90,7 +90,7 @@ ORDER BY "SELECT EXTRACT(YEAR FROM to_timestamp(start_time))::INTEGER AS year, EXTRACT(MONTH FROM to_timestamp(start_time))::INTEGER AS month, - COUNT(*) AS count + COUNT(*)::INTEGER AS count FROM builds WHERE