Sets proper 404 status in most cases
This commit is contained in:
parent
c28d45515b
commit
d38d8f1061
1 changed files with 10 additions and 11 deletions
|
@ -57,16 +57,15 @@ 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);
|
||||||
|
const channelKeys = Object.keys(showState.channelList);
|
||||||
|
|
||||||
if (assetKeys.length !== 0) {
|
if (assetKeys.length !== 0) {
|
||||||
res.claimId = showState.assetList[assetKeys[0]].claimId;
|
res.claimId = showState.assetList[assetKeys[0]].claimId;
|
||||||
} else {
|
} else if (channelKeys.length !== 0) {
|
||||||
const channelKeys = Object.keys(showState.channelList);
|
|
||||||
|
|
||||||
if(channelKeys.length !== 0) {
|
|
||||||
res.claimId = showState.channelList[channelKeys[0]].longId;
|
res.claimId = showState.channelList[channelKeys[0]].longId;
|
||||||
res.isChannel = true;
|
res.isChannel = true;
|
||||||
}
|
} else {
|
||||||
|
res.status(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// render component to a string
|
// render component to a string
|
||||||
|
|
Loading…
Reference in a new issue