From fe543e99258f246eb94a257614248d0815f1195a Mon Sep 17 00:00:00 2001 From: Lukas-Heiligenbrunner <30468956+Lukas-Heiligenbrunner@users.noreply.github.com> Date: Sat, 15 Feb 2025 15:35:58 +0100 Subject: [PATCH] fix graph types for postgres endpoint (#145) --- 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