change date type for req & design and fields & add requests & fix bug appointment and dashboard
This commit is contained in:
@@ -10,27 +10,21 @@ function ModalAddRelatives({ open, setOpen, changeData, loading, updateData }) {
|
||||
const contentItem = {
|
||||
name: "",
|
||||
relation: "",
|
||||
phone: "",
|
||||
address: "",
|
||||
contact: {
|
||||
phone: "",
|
||||
address: "",
|
||||
},
|
||||
};
|
||||
|
||||
const handleOpen = () => setOpen(true);
|
||||
const handleClose = () => setOpen(false);
|
||||
const [newItem, setNewItem] = useState(contentItem);
|
||||
const handleAddData = () => {
|
||||
const changedKey = {
|
||||
name: newItem.name,
|
||||
relation: newItem.relation,
|
||||
contact: {
|
||||
phone: newItem.phone,
|
||||
address: newItem.address,
|
||||
},
|
||||
};
|
||||
|
||||
changeData("add", "relatives", null, changedKey);
|
||||
changeData("add", "relatives", null, newItem);
|
||||
setNewItem(contentItem);
|
||||
handleClose();
|
||||
};
|
||||
console.log(newItem);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -64,8 +58,8 @@ function ModalAddRelatives({ open, setOpen, changeData, loading, updateData }) {
|
||||
disabled={
|
||||
!newItem.name ||
|
||||
!newItem.relation ||
|
||||
!newItem.phone ||
|
||||
!newItem.address
|
||||
!newItem.contact.phone ||
|
||||
!newItem.contact.address
|
||||
}
|
||||
variant="contained"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user