-
{title}
+
+ {title} {req && "*"}
+
{isConfirmed && (
@@ -35,8 +33,14 @@ function Form({ insurance, errors, changeData, information }) {
data={parsedUserInfo?.username}
/>
-
+
-
+
-
+
-
+
@@ -79,7 +88,7 @@ function Form({ insurance, errors, changeData, information }) {
list={gender}
/>
-
+
-
+
-
+
{
@@ -121,6 +135,7 @@ function Form({ insurance, errors, changeData, information }) {
isConfirmed={false}
>
-
+
@@ -142,7 +157,7 @@ function Form({ insurance, errors, changeData, information }) {
list={blood_group}
/>
-
+
@@ -164,7 +179,7 @@ function Form({ insurance, errors, changeData, information }) {
name="home_phone"
/>
-
+
@@ -176,7 +191,7 @@ function Form({ insurance, errors, changeData, information }) {
list={education}
/>
-
+
diff --git a/components/dashboard/userAccount/detailUser/information/index.js b/components/dashboard/userAccount/detailUser/information/index.js
index 4a7225e..3294da8 100644
--- a/components/dashboard/userAccount/detailUser/information/index.js
+++ b/components/dashboard/userAccount/detailUser/information/index.js
@@ -2,13 +2,15 @@ import { useEffect, useState } from "react";
import Form from "./form";
import { request } from "@/services/response";
import ButtonSendData from "./ButtonSendData";
-import { getParsedUserInfo } from "@/helper";
+import { changeDateType, getParsedUserInfo } from "@/helper";
import { disease } from "./form/disease";
+import LoadingComponent from "@/app/component/LoadingComponent";
function Information({ information, setInformation }) {
const [loading, setLoading] = useState(false);
const [insurance, setInsurance] = useState();
const [errors, setErrors] = useState({});
+ const [loadingInfo, setLoadingInfo] = useState(true);
useEffect(() => {
const parsedUserInfo = getParsedUserInfo();
@@ -23,12 +25,17 @@ function Information({ information, setInformation }) {
request
.getUserProfile(parsedUserInfo.uuid)
.then((res) => {
- const changedData = res;
+ setLoadingInfo(false);
+ let changedData = res;
+
changedData.basic_insurance = [Number(res?.basic_insurance?.id)];
changedData.prev_data = true;
+ changedData = changeDateType(changedData, false);
+
setInformation(changedData);
})
.catch((err) => {
+ setLoadingInfo(false);
if (err?.response?.data === "Entity not found") {
setInformation({
prev_data: false,
@@ -43,6 +50,8 @@ function Information({ information, setInformation }) {
});
}
});
+ } else {
+ setLoadingInfo(false);
}
}, []);
@@ -60,22 +69,24 @@ function Information({ information, setInformation }) {
};
return (
-
-
-
-
+
+
+
+
+
+
);
}
diff --git a/components/dashboard/userAccount/detailUser/relatives/index.js b/components/dashboard/userAccount/detailUser/relatives/index.js
index fcddc23..bce4e25 100644
--- a/components/dashboard/userAccount/detailUser/relatives/index.js
+++ b/components/dashboard/userAccount/detailUser/relatives/index.js
@@ -9,7 +9,6 @@ function Relatives({ data, changeData, loading, updateData }) {
const tableHead = ["ردیف", "نام", "نسبت", "شماره تماس", "آدرس", ""];
const centerTable = [0];
const [open, setOpen] = useState(false);
- console.log(relatives);
return (
diff --git a/components/dashboard/userAccount/detailUser/relatives/modal/index.js b/components/dashboard/userAccount/detailUser/relatives/modal/index.js
index 39346ce..db3e53c 100644
--- a/components/dashboard/userAccount/detailUser/relatives/modal/index.js
+++ b/components/dashboard/userAccount/detailUser/relatives/modal/index.js
@@ -24,7 +24,6 @@ function ModalAddRelatives({ open, setOpen, changeData, loading, updateData }) {
setNewItem(contentItem);
handleClose();
};
- console.log(newItem);
return (
<>
diff --git a/components/doctor/appointmentList/ItemAppointment.js b/components/doctor/appointmentList/ItemAppointment.js
index 72b336e..c61d8ac 100644
--- a/components/doctor/appointmentList/ItemAppointment.js
+++ b/components/doctor/appointmentList/ItemAppointment.js
@@ -7,7 +7,7 @@ import Image from "next/image";
import Link from "next/link";
import React from "react";
-function ItemAppointment({ turn, doctor, loading }) {
+function ItemAppointment({ turn, loading }) {
return (
-
+
-
- {doctor?.name}
-
+ {turn?.name}
- تخصص: {doctor?.expertise}
+ تخصص:
+ {turn?.expertise?.map(
+ (item, idx) =>
+ `${item.name} ${turn.expertise.length === idx + 1 ? "" : "|"} `
+ )}
@@ -41,7 +43,7 @@ function ItemAppointment({ turn, doctor, loading }) {
-
+