feat(doctor profile): implement unclaimed doctor handling and UI adjustments
This commit is contained in:
@@ -57,10 +57,12 @@ export async function generateMetadata({ params }) {
|
||||
`رزرو نوبت آنلاین دکتر ${doctor.name}${specialtyNames ? " متخصص " + specialtyNames : ""}${doctor.address ? " | " + doctor.address : ""}`.trim()
|
||||
).slice(0, 160);
|
||||
const image = imageUrl(doctor.img?.[0]?.url) || FALLBACK_IMG;
|
||||
const isUnclaimed = doctor.owner_status !== "claimed";
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
...(isUnclaimed && { robots: { index: false, follow: true } }),
|
||||
openGraph: {
|
||||
title,
|
||||
description,
|
||||
@@ -106,6 +108,7 @@ async function Doctor({ params }) {
|
||||
const addresses = doctor ? await getDoctorAddresses(doctor.id) : [];
|
||||
|
||||
const specialtyNames = doctor?.specialties?.map((s) => s.name).join(" و ") || "";
|
||||
const isUnclaimed = doctor?.owner_status !== "claimed";
|
||||
const jsonLd = doctor
|
||||
? {
|
||||
"@context": "https://schema.org",
|
||||
@@ -120,7 +123,7 @@ async function Doctor({ params }) {
|
||||
url: imageUrl(doctor.img[0].url),
|
||||
},
|
||||
}),
|
||||
...(Number(doctor.point) > 0 && {
|
||||
...(!isUnclaimed && Number(doctor.point) > 0 && {
|
||||
aggregateRating: {
|
||||
"@type": "AggregateRating",
|
||||
ratingValue: doctor.point,
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ function cityFilterParams(scope) {
|
||||
async function getDoctorUrls(baseUrl, scope) {
|
||||
const doctors = await fetchAllPages('/api/v1/doctors', cityFilterParams(scope));
|
||||
return doctors
|
||||
.filter((d) => d?.uuid)
|
||||
.filter((d) => d?.uuid && d?.owner_status === 'claimed')
|
||||
.map((d) =>
|
||||
withLastModified(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user