Commit d5246d06 authored by Caleb Weeks's avatar Caleb Weeks

adding orderByType option

parent eb7330c0
...@@ -185,12 +185,13 @@ module.exports = function restubFromBlQuery(params, cb){ ...@@ -185,12 +185,13 @@ module.exports = function restubFromBlQuery(params, cb){
var queryUrl; var queryUrl;
var orderBy = querySpecification.orderBy || ''; var orderBy = querySpecification.orderBy || '';
var orderByType = querySpecification.orderByType ? '&orderbyType=' + querySpecification.orderByType || '';
var limit = querySpecification.limit || '-1'; var limit = querySpecification.limit || '-1';
if(sc.queryType === 'loki'){ if(sc.queryType === 'loki'){
queryUrl = `/bin/collections/query${queryPath}?filters=${queryString}&orderby=${orderBy}`; queryUrl = `/bin/collections/query${queryPath}?filters=${queryString}&orderby=${orderBy}`;
}else{ }else{
queryUrl = `/bin/collections/query?path=${queryPath}&filters=${queryString}&count=${limit}&orderby=${orderBy}`; queryUrl = `/bin/collections/query?path=${queryPath}&filters=${queryString}&count=${limit}&orderby=${orderBy}${orderByType}`;
} }
sc.getSling(queryUrl, {leaveMangledNames:true}, (err, validSourcePages)=>{ sc.getSling(queryUrl, {leaveMangledNames:true}, (err, validSourcePages)=>{
if(err){cb("Problem resolving map query: " + queryPath, err); return;} if(err){cb("Problem resolving map query: " + queryPath, err); return;}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment