diff --git a/app/dashboard/admin/users/page.tsx b/app/dashboard/admin/users/page.tsx index a3a3654..05424f9 100644 --- a/app/dashboard/admin/users/page.tsx +++ b/app/dashboard/admin/users/page.tsx @@ -2,8 +2,8 @@ import Users from "@/app/features/Pages/Admin/Users/users"; export default async function BackOfficeUsersPage() { const baseUrl = - process.env.NEXT_PUBLIC_BASE_URL || process.env.VERCEL_URL - ? `https://${process.env.VERCEL_URL}` + process.env.NEXT_PUBLIC_BASE_URL + ? `https://${process.env.NEXT_PUBLIC_BASE_URL}` : "http://localhost:3000"; const res = await fetch(`${baseUrl}/api/dashboard/admin/users`, { cache: "no-store", // 👈 disables caching for SSR freshness diff --git a/app/services/transactionsHistory.ts b/app/services/transactionsHistory.ts index 7e77156..30f5cbc 100644 --- a/app/services/transactionsHistory.ts +++ b/app/services/transactionsHistory.ts @@ -3,8 +3,12 @@ export async function getTransactionsHistory({ }: { query: string; }) { + const baseUrl = + process.env.NEXT_PUBLIC_BASE_URL + ? `https://${process.env.NEXT_PUBLIC_BASE_URL}` + : "http://localhost:3000"; const res = await fetch( - `http://localhost:3000/api/dashboard/transactionsHistory?${query}`, + `${baseUrl}/api/dashboard/transactionsHistory?${query}`, { cache: "no-store", },