Skip to content

Commit

Permalink
Merge pull request #1525 from culturecreates/bugfix/issue-1520
Browse files Browse the repository at this point in the history
fix: fixed issue deleting logo automatically delete image for organiz…
  • Loading branch information
AbhishekPAnil authored Jan 10, 2025
2 parents b020cdf + 5628428 commit ace5fe6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,12 @@ function CreateNewOrganization() {
}
}
};
if ((values?.image || (values?.image && values?.image?.length > 0)) && !values?.logo) {

if (
(values?.image || (values?.image && values?.image?.length > 0)) &&
(!values?.logo || (Array.isArray(values?.logo) && values?.logo?.length === 0))
) {
organizationPayload['logo'] = [];
if (values?.image?.length > 0 && values?.image[0]?.originFileObj) {
const formdata = new FormData();
formdata.append('file', values?.image[0].originFileObj);
Expand Down Expand Up @@ -452,7 +457,7 @@ function CreateNewOrganization() {
// Main image is removed and no new image is added
// No gallery images are added
organizationPayload['image'] = [];
} else organizationPayload['image'] = imageCrop;
} else organizationPayload['image'] = organizationData?.image;
addUpdateOrganizationApiHandler(organizationPayload, toggle)
.then((id) => resolve(id))
.catch((error) => {
Expand Down

0 comments on commit ace5fe6

Please sign in to comment.