bugfix: onUpsertListingDraft was working wrongly

This commit is contained in:
Vesa Luusua 2018-01-26 16:18:14 +02:00
parent 1cbe04f27a
commit a41f329cf4
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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,
},
};
};