@@ -13,11 +13,8 @@ interface Props {
1313export default async function OrganisationPage ( props : Props ) {
1414 const { slug } = await props . params ;
1515
16- const baseUrl = process . env . VERCEL_URL
17- ? `https://${ process . env . VERCEL_URL } `
18- : 'http://localhost:3000' ;
19-
20- const res = await fetch ( `${ baseUrl } /api/service-providers/${ slug } ` , {
16+ // ✅ Use relative path for internal API call
17+ const res = await fetch ( `/api/service-providers/${ slug } ` , {
2118 cache : 'no-store' ,
2219 } ) ;
2320
@@ -37,7 +34,6 @@ export default async function OrganisationPage(props: Props) {
3734 return notFound ( ) ;
3835 }
3936
40- // Cast services
4137 const rawServices = ( data . services || [ ] ) as RawService [ ] ;
4238
4339 const services = rawServices . map ( ( service , idx ) => {
@@ -61,8 +57,8 @@ export default async function OrganisationPage(props: Props) {
6157 description : service . Info || '' ,
6258 address : service . Address || { } ,
6359 openTimes,
64- organisation : data . organisation . name , // ✅ lowercase
65- organisationSlug : data . organisation . key , // ✅ lowercase
60+ organisation : data . organisation . name ,
61+ organisationSlug : data . organisation . key ,
6662 latitude : coords [ 1 ] ,
6763 longitude : coords [ 0 ] ,
6864 clientGroups : service . ClientGroups || [ ] ,
@@ -86,7 +82,6 @@ export default async function OrganisationPage(props: Props) {
8682 groupedServices,
8783 } ;
8884
89-
9085 console . log ( '✅ DEBUG groupedServices:' , JSON . stringify ( groupedServices , null , 2 ) ) ;
9186
9287 return < OrganisationShell organisation = { organisation } /> ;
0 commit comments