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();
}
} 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();
}