Update handleShowRender.jsx

This commit is contained in:
Shawn K 2018-11-12 10:19:31 -06:00 committed by GitHub
parent 0b2b7fff92
commit eea5d67f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,9 +20,11 @@ const createCanonicalLink = require('../../../utils/createCanonicalLink');
const getCanonicalUrlFromShow = show => { const getCanonicalUrlFromShow = show => {
const requestId = show.requestList[show.request.id]; const requestId = show.requestList[show.request.id];
const requestType = show.request.type; const requestType = show.request.type;
if (!requestId || !requestType) { if (!requestId || !requestType) {
return null; return null;
} }
switch (requestType) { switch (requestType) {
case 'ASSET_DETAILS': case 'ASSET_DETAILS':
const asset = show.assetList[requestId.key]; const asset = show.assetList[requestId.key];
@ -39,6 +41,7 @@ const returnSagaWithParams = (saga, params) => {
yield call(saga, params); yield call(saga, params);
}; };
}; };
module.exports = (req, res) => { module.exports = (req, res) => {
let context = {}; let context = {};
@ -54,6 +57,7 @@ module.exports = (req, res) => {
// Workaround, remove when a solution for async httpContext exists // Workaround, remove when a solution for async httpContext exists
const showState = store.getState().show; const showState = store.getState().show;
const assetKeys = Object.keys(showState.assetList); const assetKeys = Object.keys(showState.assetList);
if(assetKeys.length !== 0) { if(assetKeys.length !== 0) {
res.claimId = showState.assetList[assetKeys[0]].claimId; res.claimId = showState.assetList[assetKeys[0]].claimId;
} else { } else {