Skip to content

Commit

Permalink
feat: user scored PRs to API
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn committed Nov 2, 2024
1 parent d8b1136 commit 935369f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/sql/get_leaderboard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SELECT
largest_score,
prs_opened,
prs_merged,
prs_scored,
weekly_streak.best as weekly_streak_best,
weekly_streak.amount as weekly_streak_amount,
weekly_streak.latest_time_string as weekly_streak_latest_time_string,
Expand Down
1 change: 1 addition & 0 deletions server/src/db/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct LeaderboardRecord {
pub largest_score: i32,
pub prs_opened: i32,
pub prs_merged: i32,
pub prs_scored: i32,
pub weekly_streak_best: i32,
pub monthly_streak_best: i32,
pub weekly_streak_latest_time_string: String,
Expand Down
2 changes: 2 additions & 0 deletions server/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub struct LeaderboardResponse {
pub merged_prs: u32,
pub score: u32,
pub place: u32,
pub scored_prs: u32,
}

impl From<LeaderboardRecord> for LeaderboardResponse {
Expand Down Expand Up @@ -132,6 +133,7 @@ impl From<LeaderboardRecord> for LeaderboardResponse {
score: record.total_score as u32,
place: record.place as u32,
rank,
scored_prs: record.prs_scored as u32,
}
}
}
Expand Down

0 comments on commit 935369f

Please sign in to comment.