update pandora.getPart
This commit is contained in:
parent
efb937a8a7
commit
08f7b1856c
1 changed files with 21 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue