Skip to content

Commit

Permalink
update: idk
Browse files Browse the repository at this point in the history
  • Loading branch information
Ba3a-G committed Oct 28, 2023
1 parent 85d6e6f commit 6dad178
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ tests
api/venv
api/aws
api/test.py
api/data.txt
api/data.txt
# Local Netlify folder
**/.netlify
**/.vscode
2 changes: 0 additions & 2 deletions api/updateLeaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def getLeaderboard():
ProjectionExpression='userid, userName, totalBadges, lastBadgeCompletedOn',
)
response = response['Items']
# sort by totalBadges and then by completedAllAt
print("sorting now")
response = sorted(response, key=lambda i: (i['totalBadges'], -i['lastBadgeCompletedOn']), reverse=True)

for i in range(len(response)):
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Leaderboard/Leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from "axios";

const loadLeaderboard = async () => {
try {
var rawLeaderboard = await axios.get('https://csjprogress.s3.ap-south-1.amazonaws.com/leaderboard.json');
var rawLeaderboard = await axios.get('https://dro7t3x3dwegt.cloudfront.net/leaderboard.json');
} catch(err) {
console.error('Couldn\'t load leaderboard.')
return []
Expand Down

0 comments on commit 6dad178

Please sign in to comment.