mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 03:43:28 +10:00
Images should not be included if they are undefined
This commit is contained in:
parent
d6707b7f1d
commit
f25d4e89c7
1 changed files with 4 additions and 2 deletions
|
|
@ -85,9 +85,11 @@ const EditListingWizardTab = props => {
|
|||
handleCreateListing({ ...listing.attributes, images: imageIdArray });
|
||||
}
|
||||
} else {
|
||||
const { images: updatedImages, ...rest } = updateValues;
|
||||
// Normalize images for API call
|
||||
const imageIdArray = imageIds(updateValues.images);
|
||||
onUpdateListing(tab, { ...updateValues, id: currentListing.id, images: imageIdArray });
|
||||
const imageProperty =
|
||||
typeof updatedImages !== 'undefined' ? { images: imageIds(updatedImages) } : {};
|
||||
onUpdateListing(tab, { ...rest, id: currentListing.id, ...imageProperty });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue