Skip to content

Commit

Permalink
feat:edit-ecosystem-modal
Browse files Browse the repository at this point in the history
Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Oct 10, 2023
1 parent 8455cd2 commit d0a410f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/EditEcosystemOrgModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const EditPopupModal = (props: EditEntityModalProps) => {
const [errMsg, setErrMsg] = useState<string | null>(null);
const [imgError, setImgError] = useState('');


useEffect(() => {
if (!props.openModal) {
setInitialEntityData({
Expand Down Expand Up @@ -145,13 +146,11 @@ const EditPopupModal = (props: EditEntityModalProps) => {
}
};

// Function to check if an object is empty
const isEmpty = (object: any): boolean => {

return true;
};

// Function to submit update operation
const submitUpdateEntity = async (values: EditEntityValues) => {
setLoading(true);

Expand All @@ -178,7 +177,7 @@ const EditPopupModal = (props: EditEntityModalProps) => {
} else {
const response = await updateEcosystem(entityData);
const { data } = response as AxiosResponse;

if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
if (props?.onEditSuccess) {
props?.onEditSuccess();
Expand All @@ -200,7 +199,10 @@ const EditPopupModal = (props: EditEntityModalProps) => {
imagePreviewUrl: "",
fileName: ''
});
setInitialEntityData(initialEntityData);
setInitialEntityData({
name: "",
description: "",
});
props.setOpenModal(false);
}}>
<Modal.Header>Edit {props.isOrganization ? "Organization" : "Ecosystem"}</Modal.Header>
Expand Down

0 comments on commit d0a410f

Please sign in to comment.