Skip to content

Commit

Permalink
fix(/api/leaderboard): don't cache fetch requests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Nov 5, 2024
1 parent a553f30 commit 697f2e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/api/leaderboard/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ export async function GET(req: NextRequest) {
env.NEXT_PUBLIC_API
)

const jsonResponse = await fetch(leaderboardRequest)
const jsonResponse = await fetch(leaderboardRequest, {
cache: "no-store",
next: { revalidate: 0 },
})
const jsonData = await jsonResponse.json()
if (!jsonResponse.ok) {
throw new Error(JSON.stringify(jsonData))
}

console.log("/api/leaderboard - jsonData", jsonData)

const csvData = convertLeaderboardToCsv(jsonData)

return new Response(csvData, {
Expand Down

0 comments on commit 697f2e7

Please sign in to comment.