mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 13:06:03 +10:00
Rename getEntities to getMarketplaceEntities
This commit is contained in:
parent
58ce53c0d9
commit
d42957de2a
4 changed files with 13 additions and 7 deletions
|
|
@ -4,7 +4,7 @@ import { connect } from 'react-redux';
|
|||
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
||||
import { PageLayout, NamedRedirect, NamedLink, PaginationLinks } from '../../components';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
import { getEntities } from '../../ducks/marketplaceData.duck';
|
||||
import { getMarketplaceEntities } from '../../ducks/marketplaceData.duck';
|
||||
import { loadData } from './InboxPage.duck';
|
||||
|
||||
import css from './InboxPage.css';
|
||||
|
|
@ -206,7 +206,7 @@ const mapStateToProps = state => {
|
|||
fetchInProgress,
|
||||
fetchOrdersOrSalesError,
|
||||
pagination,
|
||||
transactions: getEntities(marketplaceData, transactionRefs),
|
||||
transactions: getMarketplaceEntities(marketplaceData, transactionRefs),
|
||||
currentUserHasListings,
|
||||
currentUserHasListingsError,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { connect } from 'react-redux';
|
|||
import { NamedRedirect, OrderDetailsPanel, PageLayout } from '../../components';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
import { ensureBooking, ensureListing, ensureTransaction, ensureUser } from '../../util/data';
|
||||
import { getEntities } from '../../ducks/marketplaceData.duck';
|
||||
import { getMarketplaceEntities } from '../../ducks/marketplaceData.duck';
|
||||
import { loadData } from './OrderPage.duck';
|
||||
|
||||
import css from './OrderPage.css';
|
||||
|
|
@ -67,7 +67,10 @@ const mapStateToProps = state => {
|
|||
const { showListingError: showOrderError } = state.ListingPage;
|
||||
const { currentUser } = state.user;
|
||||
|
||||
const transactions = getEntities(state.marketplaceData, transactionRef ? [transactionRef] : []);
|
||||
const transactions = getMarketplaceEntities(
|
||||
state.marketplaceData,
|
||||
transactionRef ? [transactionRef] : []
|
||||
);
|
||||
const transaction = transactions.length > 0 ? transactions[0] : null;
|
||||
|
||||
return { transaction, showOrderError, currentUser };
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { connect } from 'react-redux';
|
|||
import * as propTypes from '../../util/propTypes';
|
||||
import { ensureBooking, ensureListing, ensureTransaction, ensureUser } from '../../util/data';
|
||||
import { Button, NamedRedirect, SaleDetailsPanel, PageLayout } from '../../components';
|
||||
import { getEntities } from '../../ducks/marketplaceData.duck';
|
||||
import { getMarketplaceEntities } from '../../ducks/marketplaceData.duck';
|
||||
import { acceptSale, rejectSale, loadData } from './SalePage.duck';
|
||||
|
||||
import css from './SalePage.css';
|
||||
|
|
@ -85,7 +85,10 @@ const mapStateToProps = state => {
|
|||
const { showListingError: showSaleError } = state.ListingPage;
|
||||
const { currentUser } = state.user;
|
||||
|
||||
const transactions = getEntities(state.marketplaceData, transactionRef ? [transactionRef] : []);
|
||||
const transactions = getMarketplaceEntities(
|
||||
state.marketplaceData,
|
||||
transactionRef ? [transactionRef] : []
|
||||
);
|
||||
const transaction = transactions.length > 0 ? transactions[0] : null;
|
||||
|
||||
return { transaction, showSaleError, currentUser };
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export const getListingsById = (state, listingIds) => {
|
|||
*
|
||||
* @return {Array<Object>} denormalised entities
|
||||
*/
|
||||
export const getEntities = (marketplaceData, entityRefs) => {
|
||||
export const getMarketplaceEntities = (marketplaceData, entityRefs) => {
|
||||
const type = entityRefs.length > 0 ? entityRefs[0].type : null;
|
||||
const ids = entityRefs.map(ref => ref.id);
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue