fixed show actions to use data object
This commit is contained in:
parent
cb871cae36
commit
7f52c9be02
2 changed files with 36 additions and 48 deletions
|
@ -1,48 +1,61 @@
|
|||
import * as actions from 'constants/show_action_types';
|
||||
// export action creators
|
||||
|
||||
export function updateRequestWithChannelRequest (name, id) {
|
||||
return {
|
||||
type: actions.REQUEST_UPDATE_CHANNEL,
|
||||
name,
|
||||
id,
|
||||
data: {
|
||||
name,
|
||||
id,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export function updateRequestWithAssetRequest (name, id, channelName, channelId, extension) {
|
||||
return {
|
||||
type : actions.REQUEST_UPDATE_CLAIM,
|
||||
name,
|
||||
id,
|
||||
channelName: null,
|
||||
channelId : null,
|
||||
extension,
|
||||
type: actions.REQUEST_UPDATE_CLAIM,
|
||||
data: {
|
||||
name,
|
||||
modifier: {
|
||||
id,
|
||||
channel: {
|
||||
name: channelName,
|
||||
id : channelId,
|
||||
},
|
||||
},
|
||||
extension,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export function updateChannelData (name, longId, shortId) {
|
||||
return {
|
||||
type: actions.CHANNEL_DATA_UPDATE,
|
||||
name,
|
||||
longId,
|
||||
shortId,
|
||||
data: {
|
||||
name,
|
||||
longId,
|
||||
shortId,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export function updateChannelClaimsData (claims, currentPage, totalPages, totalClaims) {
|
||||
return {
|
||||
type: actions.CHANNEL_CLAIMS_DATA_UPDATE,
|
||||
claims,
|
||||
currentPage,
|
||||
totalPages,
|
||||
totalClaims,
|
||||
data: {
|
||||
claims,
|
||||
currentPage,
|
||||
totalPages,
|
||||
totalClaims,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export function updateAssetClaimData (data, shortId) {
|
||||
return {
|
||||
type: actions.ASSET_CLAIM_DATA_UPDATE,
|
||||
data,
|
||||
shortId,
|
||||
data: {
|
||||
data,
|
||||
shortId,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
@ -48,54 +48,29 @@ export default function (state = initialState, action) {
|
|||
case actions.REQUEST_UPDATE_CHANNEL:
|
||||
return Object.assign({}, state, {
|
||||
requestType : CHANNEL,
|
||||
channelRequest: {
|
||||
name: action.name,
|
||||
id : action.id,
|
||||
},
|
||||
channelRequest: action.data,
|
||||
});
|
||||
case actions.REQUEST_UPDATE_CLAIM:
|
||||
return Object.assign({}, state, {
|
||||
requestType : ASSET,
|
||||
assetRequest: {
|
||||
name : action.name,
|
||||
modifier: {
|
||||
id : action.id,
|
||||
channel: {
|
||||
name: action.channelName,
|
||||
id : action.channelId,
|
||||
},
|
||||
},
|
||||
extension: action.extension,
|
||||
},
|
||||
assetRequest: action.data,
|
||||
});
|
||||
case actions.CHANNEL_DATA_UPDATE:
|
||||
return Object.assign({}, state, {
|
||||
showChannel: Object.assign({}, state.showChannel, {
|
||||
channelData: Object.assign({}, state.channelData, {
|
||||
name : action.name,
|
||||
shortId: action.shortId,
|
||||
longId : action.longId,
|
||||
}),
|
||||
channelData: action.data,
|
||||
}),
|
||||
});
|
||||
case actions.CHANNEL_CLAIMS_DATA_UPDATE:
|
||||
return Object.assign({}, state, {
|
||||
showChannel: Object.assign({}, state.showChannel, {
|
||||
channelClaimsData: {
|
||||
claims : action.claims,
|
||||
currentPage: action.currentPage,
|
||||
totalPages : action.totalPages,
|
||||
totalClaims: action.totalClaims,
|
||||
},
|
||||
channelClaimsData: action.data,
|
||||
}),
|
||||
});
|
||||
case actions.ASSET_CLAIM_DATA_UPDATE:
|
||||
return Object.assign({}, state, {
|
||||
showAsset: {
|
||||
claimData: {
|
||||
data : action.data,
|
||||
shortId: action.shortId,
|
||||
},
|
||||
claimData: action.data,
|
||||
},
|
||||
});
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue