Fixing baseurl for for next service
This commit is contained in:
parent
950d7707d1
commit
1af8ce94f4
@ -2,8 +2,8 @@ import Users from "@/app/features/Pages/Admin/Users/users";
|
|||||||
|
|
||||||
export default async function BackOfficeUsersPage() {
|
export default async function BackOfficeUsersPage() {
|
||||||
const baseUrl =
|
const baseUrl =
|
||||||
process.env.NEXT_PUBLIC_BASE_URL || process.env.VERCEL_URL
|
process.env.NEXT_PUBLIC_BASE_URL
|
||||||
? `https://${process.env.VERCEL_URL}`
|
? `https://${process.env.NEXT_PUBLIC_BASE_URL}`
|
||||||
: "http://localhost:3000";
|
: "http://localhost:3000";
|
||||||
const res = await fetch(`${baseUrl}/api/dashboard/admin/users`, {
|
const res = await fetch(`${baseUrl}/api/dashboard/admin/users`, {
|
||||||
cache: "no-store", // 👈 disables caching for SSR freshness
|
cache: "no-store", // 👈 disables caching for SSR freshness
|
||||||
|
|||||||
@ -3,8 +3,12 @@ export async function getTransactionsHistory({
|
|||||||
}: {
|
}: {
|
||||||
query: string;
|
query: string;
|
||||||
}) {
|
}) {
|
||||||
|
const baseUrl =
|
||||||
|
process.env.NEXT_PUBLIC_BASE_URL
|
||||||
|
? `https://${process.env.NEXT_PUBLIC_BASE_URL}`
|
||||||
|
: "http://localhost:3000";
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`http://localhost:3000/api/dashboard/transactionsHistory?${query}`,
|
`${baseUrl}/api/dashboard/transactionsHistory?${query}`,
|
||||||
{
|
{
|
||||||
cache: "no-store",
|
cache: "no-store",
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user