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:
@@ -1,7 +1,7 @@
|
||||
import DoctorPage from "@/components/doctor";
|
||||
import Layout from "@/components/layout/StLayout";
|
||||
import { getStateInfo } from "@/lib/getStateInfo";
|
||||
import axios from "axios";
|
||||
import { axiosInstance } from "@/lib/req";
|
||||
|
||||
export async function generateMetadata({ params }) {
|
||||
const { slug } = await params;
|
||||
@@ -10,7 +10,7 @@ export async function generateMetadata({ params }) {
|
||||
const siteName = matchedCity?.site_name || "نوبت 724";
|
||||
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/api/v1/doctor/${slug}`);
|
||||
const res = await axiosInstance.get(`${API_URL}/api/v1/doctor/${slug}`);
|
||||
const doctor = res.data;
|
||||
if (!doctor) return {};
|
||||
|
||||
@@ -48,10 +48,10 @@ async function Doctor({ params }) {
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
try {
|
||||
const resDoctor = await axios.get(`${API_URL}/api/v1/doctor/${slug}`);
|
||||
const resDoctor = await axiosInstance.get(`${API_URL}/api/v1/doctor/${slug}`);
|
||||
doctor = resDoctor.data;
|
||||
if (doctor) {
|
||||
const resComments = await axios.get(
|
||||
const resComments = await axiosInstance.get(
|
||||
`${API_URL}/api/v1/clinicpro/comments/${doctor.id}`
|
||||
);
|
||||
comments = resComments?.data?.data;
|
||||
|
||||
Reference in New Issue
Block a user