mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Improve docs
This commit is contained in:
parent
a61df5211e
commit
d52cbd39f6
2 changed files with 11 additions and 2 deletions
|
|
@ -251,6 +251,9 @@ export function requestImageUpload(actionPayload) {
|
|||
};
|
||||
}
|
||||
|
||||
// Update the given tab of the wizard with the given data. This saves
|
||||
// the data to the listing, and marks the tab updated so the UI can
|
||||
// display the state.
|
||||
export function requestUpdateListing(tab, data) {
|
||||
return (dispatch, getState, sdk) => {
|
||||
dispatch(updateListing(data));
|
||||
|
|
@ -271,11 +274,14 @@ export function requestUpdateListing(tab, data) {
|
|||
};
|
||||
}
|
||||
|
||||
// loadData is run for each tab of the wizard. When editing an
|
||||
// existing listing, the listing must be fetched first.
|
||||
export function loadData(params) {
|
||||
return dispatch => {
|
||||
dispatch(clearUpdatedTab());
|
||||
const { id, type } = params;
|
||||
if (type === 'new') {
|
||||
// No need to fetch anything when creating a new listing
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
const payload = {
|
||||
|
|
|
|||
|
|
@ -103,8 +103,11 @@ export const EditListingPageComponent = props => {
|
|||
|
||||
// Images are passed to EditListingForm so that it can generate thumbnails out of them
|
||||
const currentListingImages = currentListing ? currentListing.images : [];
|
||||
const draftImages = page.imageOrder.map(i => page.images[i]);
|
||||
const images = currentListingImages.concat(draftImages);
|
||||
|
||||
// Images not yet connected to the listing
|
||||
const unattachedImages = page.imageOrder.map(i => page.images[i]);
|
||||
|
||||
const images = currentListingImages.concat(unattachedImages);
|
||||
|
||||
const title = isNew
|
||||
? intl.formatMessage({ id: 'EditListingPage.titleCreateListing' })
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue