File tree 1 file changed +10
-3
lines changed
plugins/dbviewer/frontend/public/javascripts
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 178
178
this . tableStore . dispatch ( "fetchDbviewerTable" , { _silent : ! force } ) ;
179
179
} ,
180
180
getExportQuery : function ( ) {
181
+
182
+ var sort = "" ;
183
+ if ( this . sortEnabled ) {
184
+ sort = JSON . stringify ( this . preparedSortObject ) ;
185
+ }
181
186
var apiQueryData = {
182
187
api_key : countlyGlobal . member . api_key ,
183
188
app_id : countlyCommon . ACTIVE_APP_ID ,
184
- filename : "DBViewer" + moment ( ) . format ( "DD-MMM-YYYY" ) ,
189
+ // filename: "DBViewer" + moment().format("DD-MMM-YYYY"), - using passed filename from form
185
190
projection : JSON . stringify ( this . preparedProjectionFields ) ,
186
191
query : this . queryFilter ,
187
- // sort: JSON.stringify(this.preparedSortObject) ,
192
+ sort : sort ,
188
193
collection : this . collection ,
189
194
db : this . db ,
190
195
url : "/o/export/db"
251
256
} ,
252
257
preparedSortObject : function ( ) {
253
258
var ob = { } ;
254
- ob [ this . sort ] = this . isDescentSort ? - 1 : 1 ;
259
+ if ( this . sort ) {
260
+ ob [ this . sort ] = this . isDescentSort ? - 1 : 1 ;
261
+ }
255
262
return ob ;
256
263
}
257
264
} ,
You can’t perform that action at this time.
0 commit comments