change design and data list in doctor-item & handle component appointment in doctor-item & handle functionality date-picker & fix bug appointment page & add req get appointment list
This commit is contained in:
@@ -3,14 +3,26 @@ import Layout from "@/components/layout/StLayout";
|
||||
import axios from "axios";
|
||||
|
||||
async function Doctor({ params: { slug } }) {
|
||||
const response = await axios.get(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/doctor/${slug}`
|
||||
);
|
||||
const doctor = response.data;
|
||||
let doctors = null;
|
||||
let doctor = null;
|
||||
try {
|
||||
const resDoctors = await axios.get(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/doctors?active=1"
|
||||
);
|
||||
const resDoctor = await axios.get(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/doctor/${slug}`
|
||||
);
|
||||
|
||||
doctor = resDoctor.data;
|
||||
doctors = resDoctors.data.data;
|
||||
} catch (error) {
|
||||
// console.error("problem with req:", error.message);
|
||||
// return redirect("/unauthorized");
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<DoctorPage doctor={doctor} />
|
||||
<DoctorPage doctor={doctor} doctors={doctors} />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user