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:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user