mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
bugfix: onUpsertListingDraft was working wrongly
This commit is contained in:
parent
1cbe04f27a
commit
a41f329cf4
2 changed files with 7 additions and 2 deletions
|
|
@ -67,7 +67,8 @@ const EditListingWizardTab = props => {
|
|||
|
||||
const onCompleteEditListingWizardTab = (tab, updateValues) => {
|
||||
if (isNew) {
|
||||
const onUpsertListingDraft = currentListing.id ? onUpdateListingDraft : onCreateListingDraft;
|
||||
const onUpsertListingDraft =
|
||||
tab !== marketplaceTabs[0] ? onUpdateListingDraft : onCreateListingDraft;
|
||||
onUpsertListingDraft(updateValues);
|
||||
|
||||
// Create listing flow: smooth scrolling polyfill to scroll to correct tab
|
||||
|
|
|
|||
|
|
@ -191,9 +191,13 @@ export const updateImageOrder = imageOrder => ({
|
|||
});
|
||||
|
||||
export const createListingDraft = listingData => {
|
||||
const { images, ...attributes } = listingData;
|
||||
return {
|
||||
type: CREATE_LISTING_DRAFT,
|
||||
payload: { attributes: listingData },
|
||||
payload: {
|
||||
attributes,
|
||||
images,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue