File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -253,12 +253,15 @@ DatastoreRequest.prototype.save = function(entities, callback) {
253
253
callback ( err ) ;
254
254
return ;
255
255
}
256
+ if ( this . id ) {
257
+ this . isFinalized = true ;
258
+ }
256
259
var autoInserted = ( resp . mutation_result . insert_auto_id_key || [ ] ) ;
257
260
autoInserted . forEach ( function ( key , index ) {
258
261
keys [ insertIndexes [ index ] ] = entity . keyFromKeyProto ( key ) ;
259
262
} ) ;
260
263
callback ( null , isMultipleRequest ? keys : keys [ 0 ] ) ;
261
- } ) ;
264
+ } . bind ( this ) ) ;
262
265
} ;
263
266
264
267
/**
@@ -300,7 +303,12 @@ DatastoreRequest.prototype.delete = function(keys, callback) {
300
303
}
301
304
req = new pb . CommitRequest ( req ) ;
302
305
var res = pb . CommitResponse ;
303
- this . createRequest_ ( 'commit' , req , res , callback ) ;
306
+ this . createRequest_ ( 'commit' , req , res , function ( ) {
307
+ if ( this . id ) {
308
+ this . isFinalized = true ;
309
+ }
310
+ callback . apply ( null , util . toArray ( arguments ) ) ;
311
+ } . bind ( this ) ) ;
304
312
} ;
305
313
306
314
/**
You can’t perform that action at this time.
0 commit comments