From f3aa9fd44646fde0316fc810e21cc553a9ed73e0 Mon Sep 17 00:00:00 2001 From: Benjamin A <97291322+Baoufa@users.noreply.github.com> Date: Tue, 28 Nov 2023 09:31:06 +0100 Subject: [PATCH] feat: disable vercel caching (#59) --- front/src/app/api/balance/[address]/route.ts | 1 + front/src/app/api/users/[id]/route.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/front/src/app/api/balance/[address]/route.ts b/front/src/app/api/balance/[address]/route.ts index a36e4dd..9d29f24 100644 --- a/front/src/app/api/balance/[address]/route.ts +++ b/front/src/app/api/balance/[address]/route.ts @@ -7,6 +7,7 @@ export async function GET(_req: Request, { params }: { params: { address: Hex } } const result = await fetch( `https://api-sepolia.etherscan.io/api?module=account&action=balance&address=${address}&tag=latest&apikey=${process.env.ETHERSCAN_API_KEY}`, + { cache: "no-store" }, ); const resultJSON = await result.json(); const balance = BigInt(resultJSON?.result || 0); diff --git a/front/src/app/api/users/[id]/route.ts b/front/src/app/api/users/[id]/route.ts index e1090ab..8309304 100644 --- a/front/src/app/api/users/[id]/route.ts +++ b/front/src/app/api/users/[id]/route.ts @@ -22,6 +22,7 @@ export async function GET(_req: Request, { params }: { params: { id: Hex } }) { if (user?.account) { const result = await fetch( `https://api-sepolia.etherscan.io/api?module=account&action=balance&address=${user.account}&tag=latest&apikey=${process.env.ETHERSCAN_API_KEY}`, + { cache: "no-store" }, ); const resultJSON = await result.json(); balance = BigInt(resultJSON?.result || 0);