File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed
Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -404,8 +404,8 @@ declare module __Backendless {
404404 loadRelations ( parentObjectId :string , query :Backendless . LoadRelationsQueryBuilder ) :Promise < Array < Object > > ;
405405 loadRelationsSync ( parentObjectId :string , query :Backendless . LoadRelationsQueryBuilder ) :Array < Object > ;
406406
407- getObjectCount ( query ?:Backendless . DataQueryBuilder ) :Promise < number >
408- getObjectCountSync ( query ?:Backendless . DataQueryBuilder ) :number
407+ getObjectCount ( query ?:Backendless . DataQueryBuilder | string ) :Promise < number >
408+ getObjectCountSync ( query ?:Backendless . DataQueryBuilder | string ) :number
409409
410410 setRelation ( parentObject :Object , columnName :string , childObjectsArray :Array < Object > ) :Promise < string > ;
411411 setRelation ( parentObject :Object , columnName :string , childObjectIdArray :Array < string > ) :Promise < string > ;
Original file line number Diff line number Diff line change 13771377 /**
13781378 * Count of object
13791379 *
1380- * @param {DataQueryBuilder } [queryBuilder ]
1380+ * @param {String| DataQueryBuilder } [condition ]
13811381 *
13821382 * @return {Promise }
13831383 */
13861386 /**
13871387 * Count of object (sync)
13881388 *
1389- * @param {DataQueryBuilder } [queryBuilder ]
1389+ * @param {String| DataQueryBuilder } [condition ]
13901390 *
13911391 * @return {number }
13921392 */
13931393 getObjectCountSync : synchronized ( '_getObjectCount' ) ,
13941394
1395- _getObjectCount : function ( queryBuilder , async ) {
1396- var args = this . _parseFindArguments ( arguments ) ;
1397- var dataQuery = args . queryBuilder ? args . queryBuilder . build ( ) : { } ;
1395+ _getObjectCount : function ( condition , async ) {
1396+ if ( condition instanceof Async ) {
1397+ async = condition ;
1398+ condition = null ;
1399+ }
1400+
1401+ if ( condition instanceof Backendless . DataQueryBuilder ) {
1402+ condition = condition . build ( ) . condition ;
1403+ }
1404+
13981405 var url = this . restUrl + '/count' ;
1399- var isAsync = ! ! args . async ;
14001406
1401- if ( dataQuery . condition ) {
1402- url += '?where=' + encodeURIComponent ( dataQuery . condition ) ;
1407+ if ( condition ) {
1408+ url += '?where=' + encodeURIComponent ( condition ) ;
14031409 }
14041410
14051411 return Backendless . _ajax ( {
14061412 method : 'GET' ,
14071413 url : url ,
1408- isAsync : isAsync ,
1409- asyncHandler : args . async
1414+ isAsync : ! ! async ,
1415+ asyncHandler : async
14101416 } ) ;
14111417 } ,
14121418
You can’t perform that action at this time.
0 commit comments