From 88caf06261cd731a847ccd92228861e3d1d56df4 Mon Sep 17 00:00:00 2001 From: Morteza Bakhshandeh Date: Tue, 17 Dec 2024 17:11:25 +0330 Subject: [PATCH] fix: add "s" to http URL for debugging in production environment - Added "s" to `http://bcfcode.ir` in the `baseURL` to test and debug the production environment (changing it to `https://bcfcode.ir`). - Updated the `fetchCompletedChallenges` function to include the `cache: "no-store"` option in the fetch request, ensuring that the data is always freshly fetched from the server. - This change is part of debugging efforts to resolve potential HTTPS-related issues with the API requests. Note: The modification to `baseURL` is temporary for debugging purposes. Will revert once the issue is resolved. --- app/(dashboard)/leaderboard/(Table)/Data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/(dashboard)/leaderboard/(Table)/Data.ts b/app/(dashboard)/leaderboard/(Table)/Data.ts index 1209d57..4b61420 100644 --- a/app/(dashboard)/leaderboard/(Table)/Data.ts +++ b/app/(dashboard)/leaderboard/(Table)/Data.ts @@ -47,7 +47,7 @@ export async function fetchAndCreateRows() { export async function fetchCompletedChallenges() { try { // Fetch the data from your API - const response = await fetch(`${baseURL}/api/users`); + const response = await fetch(`${baseURL}/api/users`, { cache: "no-store" }); if (!response.ok) { throw new Error("Failed to fetch users"); }