From 153cb5bc9f3bb5ff5a166d0606bfb8636c82abce Mon Sep 17 00:00:00 2001 From: Ehsan Date: Sun, 14 Sep 2025 05:05:08 +0330 Subject: [PATCH] send city and state matched by domain in first request page /doctors, send data from field home page with key name, add link for name of doctor in /doctors page and active redirect linke to doctor item page --- app/component/ItemDoctor.js | 15 +++++++-------- app/doctors/page.js | 3 +++ components/home/search/RedirectLink.js | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/component/ItemDoctor.js b/app/component/ItemDoctor.js index 7d9e92f..f96f9f1 100644 --- a/app/component/ItemDoctor.js +++ b/app/component/ItemDoctor.js @@ -23,16 +23,18 @@ function ItemDoctor({ doctor }) { image-doctor
-

- {doctor?.name} -

+ +

+ {doctor?.name} +

+

@@ -89,10 +91,7 @@ function ItemDoctor({ doctor }) { diff --git a/app/doctors/page.js b/app/doctors/page.js index 30872fa..6c9ee39 100644 --- a/app/doctors/page.js +++ b/app/doctors/page.js @@ -10,6 +10,9 @@ async function Doctors({ searchParams }) { let doctors = null; try { + let newSearchParams = searchParams; + if (matchedCity) newSearchParams.city = matchedCity.name; + if (matchedState) newSearchParams.state = matchedState.name; const params = buildDoctorParams(searchParams); const response = await axios.get(`${API_URL}/api/v1/doctors`, { diff --git a/components/home/search/RedirectLink.js b/components/home/search/RedirectLink.js index f9671d5..6a10ab3 100644 --- a/components/home/search/RedirectLink.js +++ b/components/home/search/RedirectLink.js @@ -20,7 +20,7 @@ function RedirectLink({ data }) { if (specialtyItem) { filters.specialty = specialtyItem.name; } else { - filters.search = data.search; + filters.name = data.search; } }