File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -711,8 +711,19 @@ WOQLQuery.prototype.file = function(json, opts){
711711}
712712
713713WOQLQuery . prototype . order_by = function ( asc_or_desc , query ) {
714- asc_or_desc = ( asc_or_desc . json ? asc_or_desc . json ( ) : asc_or_desc ) ;
715- this . cursor [ "order_by" ] = [ asc_or_desc ]
714+ let ovars = [ ] ;
715+ if ( Array . isArrray ( asc_or_desc ) ) {
716+ for ( var i = 0 ; i < asc_or_desc . length ; i ++ ) {
717+ ovars . push ( asc_or_desc [ i ] . json ? asc_or_desc [ i ] . json ( ) : asc_or_desc [ i ] )
718+ }
719+ }
720+ else if ( typeof asc_or_desc == "string" ) {
721+ ovars . push ( { "asc" : [ asc_or_desc ] } ) ;
722+ }
723+ else {
724+ ovars . push ( asc_or_desc . json ? asc_or_desc . json ( ) : asc_or_desc )
725+ }
726+ this . cursor [ "order_by" ] = [ ovars ]
716727 if ( query ) {
717728 this . cursor [ "order_by" ] . push ( query . json ? query . json ( ) : query ) ;
718729 }
You can’t perform that action at this time.
0 commit comments