diff --git a/app/doctor/[slug]/page.js b/app/doctor/[slug]/page.js index 3507261..c02d64a 100644 --- a/app/doctor/[slug]/page.js +++ b/app/doctor/[slug]/page.js @@ -22,7 +22,11 @@ const getDoctor = cache(async (slug) => { if (res.status === 404 || res.status === 400) return null; if (!res.ok) throw new Error(`Failed to fetch doctor: ${res.status}`); const json = await res.json(); - return json?.data?.data ?? null; + const doctor = json?.data?.data ?? null; + // پزشک غیرفعال (ادمین فلگ فعال را خاموش کرده) نباید در سایت نمایش داده شود؛ + // صفحهٔ تکی هم مثل لیست عمومی 404 می‌شود. + if (doctor?.is_active === false) return null; + return doctor; }); const getDoctorAddresses = cache(async (doctorId) => {