fix bug dashboard bugs & handle request update data in user profile & change design button in home page
This commit is contained in:
@@ -5,8 +5,8 @@ import ItemAllergie from "./ItemAllergie";
|
||||
import ModalAddAlergie from "./modal";
|
||||
|
||||
function Allergies({ data, changeData, updateData, loading }) {
|
||||
const { other } = data;
|
||||
const { allergies } = other && other[0];
|
||||
const allergies =
|
||||
data && data.other && data.other[0] && data.other[0].allergies;
|
||||
const tableHead = ["ردیف", "ماده آلرژیزا", "واکنش", "شدت", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
@@ -5,8 +5,7 @@ import Head from "@/components/dashboard/userAccount/components/Head";
|
||||
import UpdateBtn from "@/components/dashboard/userAccount/components/UpdateBtn";
|
||||
|
||||
function Disease({ data, setData, updateData, loading }) {
|
||||
const { other } = data;
|
||||
const { disease } = other && other[0];
|
||||
const disease = data && data.other && data.other[0] && data.other[0].disease;
|
||||
const tableHead = ["ردیف", "اسم", "وضعیت", ""];
|
||||
const centerTable = [0];
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import ModalAddHistory from "./modal";
|
||||
import ItemHistory from "./ItemHistory";
|
||||
|
||||
function FamilyHistory({ data, changeData, loading, updateData }) {
|
||||
const { other } = data;
|
||||
const { family_history } = other && other[0];
|
||||
const family_history =
|
||||
data && data.other && data.other[0] && data.other[0].family_history;
|
||||
const tableHead = ["ردیف", "بیماری", "نسبت خانوادگی", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
@@ -19,14 +19,12 @@ function Information({
|
||||
const [insurance, setInsurance] = useState();
|
||||
|
||||
useEffect(() => {
|
||||
request
|
||||
.getInsuranceType()
|
||||
.then((res) => {
|
||||
if (res && res.data) {
|
||||
setInsurance(res.data);
|
||||
}
|
||||
})
|
||||
// .catch((err) => {});
|
||||
request.getInsuranceType().then((res) => {
|
||||
if (res && res.data) {
|
||||
setInsurance(res.data);
|
||||
}
|
||||
});
|
||||
// .catch((err) => {});
|
||||
}, []);
|
||||
|
||||
const changeData = (value, type, name) => {
|
||||
@@ -39,17 +37,19 @@ function Information({
|
||||
|
||||
const sendReq = () => {
|
||||
setLoading(true);
|
||||
console.log(data);
|
||||
|
||||
request[dataUser ? "patchUserProfile" : "postUserProfile"](
|
||||
data,
|
||||
dataUser ? dataUser.uuid : Cookies.get("uuid")
|
||||
)
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
if (!dataUser) {
|
||||
updateDataUser();
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5,8 +5,8 @@ import ItemMedication from "./ItemMedication";
|
||||
import ModalAddMedications from "./modal";
|
||||
|
||||
function Medications({ data, changeData, updateData, loading }) {
|
||||
const { other } = data;
|
||||
const { medications } = other && other[0];
|
||||
const medications =
|
||||
data && data.other && data.other[0] && data.other[0].medications;
|
||||
const tableHead = ["ردیف", "نام دارو", "دوز مصرفی", "تعداد و زمان مصرف", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
@@ -5,8 +5,8 @@ import ModalAddRelatives from "./modal";
|
||||
import ItemRelatives from "./ItemRelatives";
|
||||
|
||||
function Relatives({ data, changeData, loading, updateData }) {
|
||||
const { other } = data;
|
||||
const { relatives } = other && other[0];
|
||||
const relatives =
|
||||
data && data.other && data.other[0] && data.other[0].relatives;
|
||||
const tableHead = ["ردیف", "نام", "نسبت", "شماره تماس", "آدرس", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
@@ -5,8 +5,8 @@ import ItemSurgeries from "./ItemSurgeries";
|
||||
import ModalAddSurgeries from "./modal";
|
||||
|
||||
function Surgeries({ data, changeData, loading, updateData }) {
|
||||
const { other } = data;
|
||||
const { surgeries } = other && other[0];
|
||||
const surgeries =
|
||||
data && data.other && data.other[0] && data.other[0].surgeries;
|
||||
const tableHead = [
|
||||
"ردیف",
|
||||
"نوع جراحی",
|
||||
|
||||
Reference in New Issue
Block a user