diff --git a/static/js/utils.js b/static/js/utils.js index 8665720a..f3e3a0b3 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1472,8 +1472,7 @@ pandora.getPart = function(state, str, callback) { callback(); } } else if (state.page == 'documents') { - var split = str.split('/')[0], - id = split; + var id = str.split('/')[0]; if (id) { pandora.api.findDocuments({ query: { @@ -1493,6 +1492,26 @@ pandora.getPart = function(state, str, callback) { state.page = ''; callback(); } + } else if (state.page == 'entities') { + var id = str; + if (id) { + pandora.api.findEntities({ + query: { + conditions: [{key: 'id', value: id, operator: '=='}], + operator: '&' + } + }, function(result) { + if (result.data.items) { + state.part = str; + } else { + state.page = ''; + } + callback(); + }); + } else { + state.page = ''; + callback(); + } } else { callback(); }