Fixed issue with database query and implemented review suggestions
This commit is contained in:
parent
1f2256c721
commit
08cc107388
@ -12,7 +12,7 @@ async function getLeaders(number_limit: number, time_limit: number) {
|
||||
AND NOT (users.username = 'colouringlondon')
|
||||
GROUP by users.username
|
||||
ORDER BY number_edits DESC
|
||||
LIMIT $2`, [number_limit, time_limit]
|
||||
LIMIT $2`, [time_limit, number_limit]
|
||||
);
|
||||
|
||||
}else{
|
||||
|
@ -22,7 +22,7 @@ import './leaderboard.css';
|
||||
}
|
||||
|
||||
|
||||
class LeaderBoardPage extends Component<LeaderboardProps, LeaderboardState> {
|
||||
class LeaderboardPage extends Component<LeaderboardProps, LeaderboardState> {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@ -99,7 +99,7 @@ class LeaderBoardPage extends Component<LeaderboardProps, LeaderboardState> {
|
||||
const number_edits = u.number_edits;
|
||||
|
||||
return (
|
||||
<tr key={i}>
|
||||
<tr key={username}>
|
||||
<td>{i+1}</td>
|
||||
<td>{username}</td>
|
||||
<td>{number_edits}</td>
|
||||
@ -145,5 +145,5 @@ class LeaderBoardPage extends Component<LeaderboardProps, LeaderboardState> {
|
||||
}
|
||||
|
||||
|
||||
export default LeaderBoardPage;
|
||||
export default LeaderboardPage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user