renamed previousRequests to requestList

This commit is contained in:
bill bittner 2018-02-14 12:19:43 -08:00
parent 0cecc84dde
commit 0548906c4d
11 changed files with 14 additions and 16 deletions

View file

@ -39,7 +39,7 @@ export function onNewAssetRequest (name, id, channelName, channelId, extension)
};
};
export function addRequestToPreviousRequests (id, error, key) {
export function addRequestToRequestList (id, error, key) {
return {
type: actions.PREVIOUS_REQUEST_ADD,
data: { id, error, key },

View file

@ -7,7 +7,7 @@ const mapStateToProps = ({ show }) => {
const error = show.displayAsset.error;
const status = show.displayAsset.status;
// select asset
const request = show.previousRequests[show.request.id];
const request = show.requestList[show.request.id];
const assetKey = request.key;
const asset = show.assetList[assetKey];
// return props

View file

@ -3,7 +3,7 @@ import View from './view';
const mapStateToProps = ({ show }) => {
// select asset
const request = show.previousRequests[show.request.id];
const request = show.requestList[show.request.id];
const assetKey = request.key;
const asset = show.assetList[assetKey];
// return props

View file

@ -3,7 +3,7 @@ import View from './view';
const mapStateToProps = ({ show }) => {
// select title
const request = show.previousRequests[show.request.id];
const request = show.requestList[show.request.id];
const assetKey = request.key;
const asset = show.assetList[assetKey];
let title;

View file

@ -2,12 +2,11 @@ import { connect } from 'react-redux';
import View from './view';
const mapStateToProps = ({ show }) => {
console.log('mapping state to props', show);
// select request info
const requestId = show.request.id;
// select asset info
let asset;
const request = show.previousRequests[requestId] || null;
const request = show.requestList[requestId] || null;
const assetList = show.assetList;
if (request && assetList) {
const assetKey = request.key; // note: just store this in the request

View file

@ -2,12 +2,11 @@ import { connect } from 'react-redux';
import View from './view';
const mapStateToProps = ({ show }) => {
console.log('mapping state to props', show);
// select request info
const requestId = show.request.id;
// select asset info
let asset;
const request = show.previousRequests[requestId] || null;
const request = show.requestList[requestId] || null;
const assetList = show.assetList;
if (request && assetList) {
const assetKey = request.key; // note: just store this in the request

View file

@ -5,7 +5,7 @@ const mapStateToProps = ({ show }) => {
// select request info
const requestId = show.request.id;
// select request
const previousRequest = show.previousRequests[requestId] || null;
const previousRequest = show.requestList[requestId] || null;
// select channel
let channel;
if (previousRequest) {

View file

@ -4,7 +4,7 @@ import View from './view';
const mapStateToProps = ({ show }) => {
// select channel key
const request = show.previousRequests[show.request.id];
const request = show.requestList[show.request.id];
const channelKey = request.key;
// select channel claims
const channel = show.channelList[channelKey] || null;

View file

@ -7,7 +7,7 @@ const initialState = {
type : null,
id : null,
},
previousRequests: {},
requestList: {},
channelList : {},
assetList : {},
displayAsset : {
@ -36,7 +36,7 @@ export default function (state = initialState, action) {
// store requests
case actions.PREVIOUS_REQUEST_ADD:
return Object.assign({}, state, {
previousRequests: Object.assign({}, state.previousRequests, {
requestList: Object.assign({}, state.requestList, {
[action.data.id]: {
error: action.data.error,
key : action.data.key,

View file

@ -1,6 +1,6 @@
import { call, put, takeLatest } from 'redux-saga/effects';
import * as actions from 'constants/show_action_types';
import { addRequestToPreviousRequests, onRequestError, addAssetToAssetList } from 'actions/show';
import { addRequestToRequestList, onRequestError, addAssetToAssetList } from 'actions/show';
import { getLongClaimId, getShortId, getClaimData } from 'api/assetApi';
function* newAssetRequest (action) {
@ -16,7 +16,7 @@ function* newAssetRequest (action) {
}
// put action to add request to asset request list
const assetKey = `a#${name}#${longId}`;
yield put(addRequestToPreviousRequests(requestId, null, assetKey));
yield put(addRequestToRequestList(requestId, null, assetKey));
// get short Id
console.log(`getting asset short id ${name} ${longId}`);
let shortId;

View file

@ -1,6 +1,6 @@
import { call, put, takeLatest } from 'redux-saga/effects';
import * as actions from 'constants/show_action_types';
import { addNewChannelToChannelList, addRequestToPreviousRequests, onRequestError, updateChannelClaims } from 'actions/show';
import { addNewChannelToChannelList, addRequestToRequestList, onRequestError, updateChannelClaims } from 'actions/show';
import { getChannelClaims, getChannelData } from 'api/channelApi';
function* getNewChannelAndUpdateChannelList (action) {
@ -15,7 +15,7 @@ function* getNewChannelAndUpdateChannelList (action) {
}
// store the request in the channel requests list
const channelKey = `c#${channelName}#${longId}`;
yield put(addRequestToPreviousRequests(requestId, null, channelKey));
yield put(addRequestToRequestList(requestId, null, channelKey));
// get channel claims data
console.log('getting channel claims data');
let claimsData;