save state selected in modal filter, filter list with location selected, save data sort, filter list with sort point, real all url from .env file, change name of value category and specialties to persian and change functional find data with field
This commit is contained in:
@@ -4,12 +4,12 @@ import axios from "axios";
|
||||
|
||||
async function Appointment({ params: { slug } }) {
|
||||
const { matchedCity } = getStateInfo();
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
let apt = null;
|
||||
try {
|
||||
const response = await axios.get(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/appointment-slots"
|
||||
);
|
||||
const response = await axios.get(`${API_URL}/api/v1/appointment-slots`);
|
||||
|
||||
apt = response.data.data;
|
||||
} catch (error) {
|
||||
// console.error("problem with req:", error.message);
|
||||
|
||||
@@ -3,10 +3,10 @@ import Layout from "@/components/layout/StLayout";
|
||||
import { fetchReq } from "@/lib/req";
|
||||
|
||||
async function Blog({ params: { slug } }) {
|
||||
const blog = await fetchReq(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/blog/${slug}`
|
||||
);
|
||||
const blogs = await fetchReq("https://back-dev.clinic-pro.ir/api/v1/blogs");
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
const blog = await fetchReq(`${API_URL}/api/v1/blog/${slug}`);
|
||||
const blogs = await fetchReq(`${API_URL}/api/v1/blogs`);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ import Layout from "@/components/layout/StLayout";
|
||||
import { fetchReq } from "@/lib/req";
|
||||
|
||||
export default async function Blogs() {
|
||||
const response = await fetchReq(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/blogs"
|
||||
);
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
const response = await fetchReq(`${API_URL}/api/v1/blogs`);
|
||||
const blogs = response.blogs;
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,12 +3,14 @@ import Layout from "@/components/layout/StLayout";
|
||||
import { fetchReq } from "@/lib/req";
|
||||
|
||||
async function Clinic({ params: { slug } }) {
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
const reqClinics = await fetchReq(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/clinic/${slug}`
|
||||
`${API_URL}/api/v1/clinic/${slug}`
|
||||
);
|
||||
|
||||
const reqDoctors = await fetchReq(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/doctors"
|
||||
`${API_URL}/api/v1/doctors`
|
||||
);
|
||||
|
||||
const clinic = reqClinics;
|
||||
|
||||
+2
-3
@@ -6,10 +6,9 @@ import { getStateInfo } from "@/lib/getStateInfo";
|
||||
|
||||
export default async function Clinics() {
|
||||
const { matchedCity, matchedState } = getStateInfo();
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
const clinics = await fetchReq(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/clinics"
|
||||
);
|
||||
const clinics = await fetchReq(`${API_URL}/api/v1/clinics`);
|
||||
|
||||
return (
|
||||
<Layout name="/clinics">
|
||||
|
||||
@@ -6,19 +6,21 @@ 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(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/doctors?active=1"
|
||||
`${API_URL}/api/v1/doctors?active=1`
|
||||
);
|
||||
const resDoctor = await axios.get(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/doctor/${slug}`
|
||||
`${API_URL}/api/v1/doctor/${slug}`
|
||||
);
|
||||
|
||||
doctor = resDoctor.data;
|
||||
doctors = resDoctors.data.data;
|
||||
if (doctor) {
|
||||
const resComments = await axios.get(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/clinicpro/comments/${doctor.id}`
|
||||
`${API_URL}/api/v1/clinicpro/comments/${doctor.id}`
|
||||
);
|
||||
comments = resComments?.data?.data;
|
||||
}
|
||||
|
||||
+4
-6
@@ -5,6 +5,7 @@ import axios from "axios";
|
||||
|
||||
async function Doctors({ searchParams }) {
|
||||
const { matchedCity, matchedState } = getStateInfo();
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
let doctors = null;
|
||||
try {
|
||||
@@ -13,12 +14,9 @@ async function Doctors({ searchParams }) {
|
||||
if (matchedCity) params.city = matchedCity?.id || null;
|
||||
if (matchedState) params.state = matchedState?.id || null;
|
||||
|
||||
const response = await axios.get(
|
||||
"https://back-dev.clinic-pro.ir/api/v1/doctors",
|
||||
{
|
||||
params,
|
||||
}
|
||||
);
|
||||
const response = await axios.get(`${API_URL}/api/v1/doctors`, {
|
||||
params,
|
||||
});
|
||||
doctors = response.data.data;
|
||||
} catch (error) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user