Fixed issue with database query and implemented review suggestions

This commit is contained in:
Martin-dJ 2020-01-06 18:10:42 +00:00
parent 1f2256c721
commit 08cc107388
2 changed files with 4 additions and 4 deletions

View File

@ -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{

View File

@ -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;