add state of page in url, add location and working_days on list in clinics page, fix update list clinic with page and limit value, hide pagination when list of clinic is empty, round image of doctor and appo in doctor item

This commit is contained in:
ehsan
2025-09-30 15:58:31 +03:30
parent ae8c49bd07
commit 645da72002
22 changed files with 98 additions and 136 deletions
+1 -5
View File
@@ -24,11 +24,7 @@ export default async function Clinics({ searchParams }) {
else if (matchedCity && matchedCity.id !== "600")
newSearchParams.city = matchedCity.name;
const params = {
...buildClinicParams(newSearchParams),
page: 1,
limit: 12,
};
const params = buildClinicParams(newSearchParams);
// Req
clinics = await fetchReq(`${API_URL}/api/v1/clinics`, {
+1 -1
View File
@@ -11,7 +11,7 @@ import ArrowLeftD from "@/components/icons/ArrowLeftD";
import ClockD from "@/components/icons/ClockD";
import LikeD from "@/components/icons/LikeD";
import PointD from "@/components/icons/PointD";
import { convertTimestampToPersianDate, convertTimestampToPersianDateSimple } from "@/components/doctors/listDoctors/timestamp_to_persian_date";
import { convertTimestampToPersianDateSimple } from "@/helper";
moment.loadPersian({ dialect: "persian-modern" });
+1 -1
View File
@@ -9,7 +9,7 @@ function PaginationContent({ page, pageDetail, changePage, limit = 12 }) {
page={page || 1}
onChange={changePage}
color="primary"
className={count < 2 && "!hidden"}
className={(!count || count < 2) && "!hidden"}
sx={{
"& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root": {
color: "#616161",
+2 -9
View File
@@ -3,21 +3,14 @@ import Layout from "@/components/layout/StLayout";
import axios from "axios";
async function Doctor({ params: { slug } }) {
let doctors = null;
let doctor = null;
let comments = null;
const API_URL = process.env.NEXT_PUBLIC_API_URL;
try {
const resDoctors = await axios.get(
`${API_URL}/api/v1/doctors?active=1`
);
const resDoctor = await axios.get(
`${API_URL}/api/v1/doctor/${slug}`
);
const resDoctor = await axios.get(`${API_URL}/api/v1/doctor/${slug}`);
doctor = resDoctor.data;
doctors = resDoctors.data.data;
if (doctor) {
const resComments = await axios.get(
`${API_URL}/api/v1/clinicpro/comments/${doctor.id}`
@@ -31,7 +24,7 @@ async function Doctor({ params: { slug } }) {
return (
<Layout>
<DoctorPage doctor={doctor} doctors={doctors} comments={comments} />
<DoctorPage doctor={doctor} comments={comments} />
</Layout>
);
}