Skip to content

Commit

Permalink
Debugging for delete modal refrehs bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-Hundal committed Nov 30, 2023
1 parent 8765f47 commit cd04784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const OIPCItem = (props) => {
const [showDeleteModal, setShowDeleteModal] = useState(false);
const [showOutcomeModal, setShowOutcomeModal] = useState(false);
const [showAmendModal, setShowAmendModal] = useState(false);

console.log("ITEM", oipc)

//Functions
const generateNamesFromOIPCId = (oipcObj) => {
Expand Down Expand Up @@ -147,12 +149,12 @@ const OIPCItem = (props) => {

return (
<>
<div style={{display: "flex", flexDirection: "row", justifyContent: "flex-end"}}>
<div key={oipc.id} style={{display: "flex", flexDirection: "row", justifyContent: "flex-end"}}>
<button onClick={() => setShowDeleteModal(true)} style={{ border: "none", background: "none" }}>
<FontAwesomeIcon icon={faTrash} color="#38598A" />
</button>
</div>
{showDeleteModal && <RemoveOIPCModal removeOIPC={removeOIPC} showModal={showDeleteModal} setShowModal={setShowDeleteModal} oipcid={oipc.id} />}
{showDeleteModal && <RemoveOIPCModal removeOIPC={removeOIPC} showModal={showDeleteModal} setShowModal={setShowDeleteModal} oipcid={oipc} />}
{showOutcomeModal && <OutcomeModal updateOIPC={updateOIPC} showModal={showOutcomeModal} setShowModal={setShowOutcomeModal} setOipc={setOipc} oipc={oipc} />}
{showAmendModal && <AmendModal updateOIPC={updateOIPC} showModal={showAmendModal} setShowModal={setShowAmendModal} setOipc={setOipc} oipc={oipc} />}
<Grid container spacing={1}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const RemoveOIPCModal= ({
showModal,
removeOIPC,
setShowModal,
oipcid,
oipc,
}) =>{

const handleSave = () => {
setShowModal(false);
removeOIPC(oipcid)
removeOIPC(oipc.id)
};
const handleClose = () => {
setShowModal(false);
Expand Down

0 comments on commit cd04784

Please sign in to comment.