update pandora.getPart

This commit is contained in:
rolux 2014-11-20 13:37:02 +00:00
parent efb937a8a7
commit 08f7b1856c

View file

@ -1472,8 +1472,7 @@ pandora.getPart = function(state, str, callback) {
callback(); callback();
} }
} else if (state.page == 'documents') { } else if (state.page == 'documents') {
var split = str.split('/')[0], var id = str.split('/')[0];
id = split;
if (id) { if (id) {
pandora.api.findDocuments({ pandora.api.findDocuments({
query: { query: {
@ -1493,6 +1492,26 @@ pandora.getPart = function(state, str, callback) {
state.page = ''; state.page = '';
callback(); 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 { } else {
callback(); callback();
} }