File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,10 @@ interface Props {
1313export default async function OrganisationPage ( props : Props ) {
1414 const { slug } = await props . params ;
1515
16- // ✅ Use relative path for internal API call
17- const res = await fetch ( `/api/service-providers/${ slug } ` , {
16+ // ✅ Use absolute URL for server fetch
17+ const baseUrl = process . env . NEXT_PUBLIC_BASE_URL || 'http://localhost:3000' ;
18+
19+ const res = await fetch ( `${ baseUrl } /api/service-providers/${ slug } ` , {
1820 cache : 'no-store' ,
1921 } ) ;
2022
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import { decodeHtmlEntities } from '@/utils/htmlDecode';
66import { categoryKeyToName , subCategoryKeyToName } from '@/utils/categoryLookup' ;
77
88export default async function FindHelpPage ( ) {
9- // ✅ Use relative URL for internal API call — safe for local and Vercel
10- const res = await fetch ( '/api/services?limit=1000' , { cache : 'no-store' } ) ;
9+ // ✅ Use absolute URL for server fetch, relative for client
10+ const baseUrl = process . env . NEXT_PUBLIC_BASE_URL || 'http://localhost:3000' ;
11+
12+ const res = await fetch ( `${ baseUrl } /api/services?limit=1000` , { cache : 'no-store' } ) ;
1113
1214 if ( ! res . ok ) {
1315 throw new Error ( `Failed to fetch services: ${ res . status } ` ) ;
You can’t perform that action at this time.
0 commit comments