Skip to content

Commit 935369f

Browse files
committed
feat: user scored PRs to API
1 parent d8b1136 commit 935369f

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

server/.sqlx/query-4311e3c06d78c4e89d02f37dc509c022d556434529f8f340ac230a9c5e8e354c.json renamed to server/.sqlx/query-5c9c5c0c4116a9b18fb2b981cda5a55b929a4219f9ec80f4f5c231f2e7a55596.json

Lines changed: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/sql/get_leaderboard.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SELECT
77
largest_score,
88
prs_opened,
99
prs_merged,
10+
prs_scored,
1011
weekly_streak.best as weekly_streak_best,
1112
weekly_streak.amount as weekly_streak_amount,
1213
weekly_streak.latest_time_string as weekly_streak_latest_time_string,

server/src/db/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub struct LeaderboardRecord {
1111
pub largest_score: i32,
1212
pub prs_opened: i32,
1313
pub prs_merged: i32,
14+
pub prs_scored: i32,
1415
pub weekly_streak_best: i32,
1516
pub monthly_streak_best: i32,
1617
pub weekly_streak_latest_time_string: String,

server/src/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub struct LeaderboardResponse {
9191
pub merged_prs: u32,
9292
pub score: u32,
9393
pub place: u32,
94+
pub scored_prs: u32,
9495
}
9596

9697
impl From<LeaderboardRecord> for LeaderboardResponse {
@@ -132,6 +133,7 @@ impl From<LeaderboardRecord> for LeaderboardResponse {
132133
score: record.total_score as u32,
133134
place: record.place as u32,
134135
rank,
136+
scored_prs: record.prs_scored as u32,
135137
}
136138
}
137139
}

0 commit comments

Comments
 (0)