mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Separate sdkResponse and apiResponse in naming
This commit is contained in:
parent
76a5f7af44
commit
9a64952105
2 changed files with 10 additions and 8 deletions
|
|
@ -34,10 +34,11 @@ const initialState = {
|
|||
|
||||
const resultIds = data => data.data.map(l => l.id);
|
||||
|
||||
const merge = (state, apiResponse) => {
|
||||
const merge = (state, sdkResponse) => {
|
||||
const apiResponse = sdkResponse.data;
|
||||
return {
|
||||
...state,
|
||||
ownEntities: updatedEntities({ ...state.ownEntities }, apiResponse.data),
|
||||
ownEntities: updatedEntities({ ...state.ownEntities }, apiResponse),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -179,9 +180,9 @@ export const getOwnEntities = (state, entityRefs) => {
|
|||
// This works the same way as addMarketplaceEntities,
|
||||
// but we don't want to mix own listings with searched listings
|
||||
// (own listings data contains different info - e.g. exact location etc.)
|
||||
export const addOwnEntities = apiResponse => ({
|
||||
export const addOwnEntities = sdkResponse => ({
|
||||
type: ADD_OWN_ENTITIES,
|
||||
payload: apiResponse,
|
||||
payload: sdkResponse,
|
||||
});
|
||||
|
||||
export const openListingRequest = listingId => ({
|
||||
|
|
|
|||
|
|
@ -11,10 +11,11 @@ const initialState = {
|
|||
entities: {},
|
||||
};
|
||||
|
||||
const merge = (state, apiResponse) => {
|
||||
const merge = (state, sdkResponse) => {
|
||||
const apiResponse = sdkResponse.data;
|
||||
return {
|
||||
...state,
|
||||
entities: updatedEntities({ ...state.entities }, apiResponse.data),
|
||||
entities: updatedEntities({ ...state.entities }, apiResponse),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ export const getMarketplaceEntities = (state, entityRefs) => {
|
|||
|
||||
// ================ Action creators ================ //
|
||||
|
||||
export const addMarketplaceEntities = apiResponse => ({
|
||||
export const addMarketplaceEntities = sdkResponse => ({
|
||||
type: ADD_MARKETPLACE_ENTITIES,
|
||||
payload: apiResponse,
|
||||
payload: sdkResponse,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue