File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 6
6
const _ = require ( 'underscore' ) ;
7
7
const AVError = require ( './error' ) ;
8
8
const AVRequest = require ( './request' ) . request ;
9
+ const filterOutCallbacks = require ( './utils' ) . filterOutCallbacks ;
9
10
10
11
// AV.Query is a way to create a list of AV.Objects.
11
12
module . exports = function ( AV ) {
@@ -200,7 +201,7 @@ module.exports = function(AV) {
200
201
var self = this ;
201
202
self . equalTo ( 'objectId' , objectId ) ;
202
203
203
- return self . first ( ) . then ( function ( response ) {
204
+ return self . first ( filterOutCallbacks ( options ) ) . then ( function ( response ) {
204
205
if ( ! _ . isEmpty ( response ) ) {
205
206
return response ;
206
207
}
Original file line number Diff line number Diff line change 6
6
const _ = require ( 'underscore' ) ;
7
7
const AVError = require ( './error' ) ;
8
8
const AVRequest = require ( './request' ) . request ;
9
+ const filterOutCallbacks = require ( './utils' ) . filterOutCallbacks ;
9
10
10
11
module . exports = function ( AV ) {
11
12
/**
@@ -1122,10 +1123,3 @@ module.exports = function(AV) {
1122
1123
1123
1124
} ) ;
1124
1125
} ;
1125
-
1126
- function filterOutCallbacks ( options ) {
1127
- var newOptions = _ . clone ( options ) || { } ;
1128
- delete newOptions . success ;
1129
- delete newOptions . error ;
1130
- return newOptions ;
1131
- }
Original file line number Diff line number Diff line change @@ -566,8 +566,17 @@ const init = (AV) => {
566
566
} ;
567
567
} ;
568
568
569
+ function filterOutCallbacks ( options ) {
570
+ var newOptions = _ . clone ( options ) || { } ;
571
+ delete newOptions . success ;
572
+ delete newOptions . error ;
573
+ return newOptions ;
574
+ }
575
+
576
+
569
577
module . exports = {
570
578
init,
571
579
isNullOrUndefined,
572
580
ensureArray,
581
+ filterOutCallbacks,
573
582
} ;
You can’t perform that action at this time.
0 commit comments