fix: use SSL-tolerant axios instance for server-side API calls
صفحات سرور (doctors, doctor/[slug], appointment/[doctorId]) از axios خام استفاده میکردند که گواهی self-signed ddev محلی را رد میکرد (unable to verify the first certificate). حالا از axiosInstance/fetchReq در lib/req استفاده میکنند که در development آن را میپذیرد. افزودن clinic-pro.ddev.site (http/https) به remotePatterns تصاویر. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+2
-3
@@ -2,7 +2,7 @@ import DoctorsPage from "@/components/doctors";
|
||||
import Layout from "@/components/layout/StLayout";
|
||||
import { buildDoctorParams } from "@/helper";
|
||||
import { getStateInfo } from "@/lib/getStateInfo";
|
||||
import axios from "axios";
|
||||
import { fetchReq } from "@/lib/req";
|
||||
|
||||
export async function generateMetadata() {
|
||||
const { matchedCity, matchedState } = await getStateInfo();
|
||||
@@ -44,10 +44,9 @@ async function Doctors({ searchParams }) {
|
||||
|
||||
const params = buildDoctorParams(newSearchParams);
|
||||
|
||||
const response = await axios.get(`${API_URL}/api/v1/doctors`, {
|
||||
doctors = await fetchReq(`${API_URL}/api/v1/doctors`, {
|
||||
params,
|
||||
});
|
||||
doctors = response.data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching doctors:", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user