@@ -307,7 +307,6 @@ export function makeSearchAreaInfo(cisxUI) {
307307}
308308
309309let tblCnt = 1 ;
310- const CHECK_SORT = false ;
311310
312311export function makeServiceDescriptorSearchRequest ( request , serviceDescriptor , extraMeta = { } ) {
313312 const { standardID = '' , accessURL, utype, serDefParams, title, cisxUI= [ ] } = serviceDescriptor ;
@@ -319,14 +318,11 @@ export function makeServiceDescriptorSearchRequest(request, serviceDescriptor, e
319318 const hideObj = hiddenColumns ?
320319 Object . fromEntries ( hiddenColumns . split ( ',' ) . map ( ( c ) => [ `col.${ c } .visibility` , 'hide' ] ) ) : { } ;
321320
322- const sAry = tblSortOrder ?. split ( ',' , 2 ) ;
321+ const sAry = tblSortOrder ?. match ( / ( [ ^ , ] + ) , ( . + ) / ) ;
323322 let sortObj = { } ;
324- if ( sAry ?. length > 1 && CHECK_SORT ) {
325- const dir = sAry [ 0 ] . toUpperCase ( ) ;
326- sortObj = { sortInfo : sortInfoString ( tblSortOrder . substring ( dir . length + 1 ) , dir === 'ASC' ) } ;
327- // console.log('from service def: '+tblSortOrder);
328- // console.log('using sortInfoString)(): '+sortObj.sortInfo);
329- // sortObj= {sortInfo: tblSortOrder};
323+ if ( sAry ) {
324+ const [ , dir , sortBy ] = sAry ;
325+ sortObj = { sortInfo : sortInfoString ( sortBy , dir ?. toUpperCase ( ) === 'ASC' ) } ;
330326 }
331327
332328 const options = { ...sortObj , META_INFO : { ...hideObj , ...extraMeta } } ;
0 commit comments