@@ -2134,6 +2134,9 @@ const DefaultController = {
2134
2134
2135
2135
const RESTController = CoreManager . getRESTController ( ) ;
2136
2136
const stateController = CoreManager . getObjectStateController ( ) ;
2137
+
2138
+ options = options || { } ;
2139
+ options . returnStatus = options . returnStatus || true ;
2137
2140
if ( Array . isArray ( target ) ) {
2138
2141
if ( target . length < 1 ) {
2139
2142
return Promise . resolve ( [ ] ) ;
@@ -2199,9 +2202,11 @@ const DefaultController = {
2199
2202
batchReady . push ( ready ) ;
2200
2203
const task = function ( ) {
2201
2204
ready . resolve ( ) ;
2202
- return batchReturned . then ( ( responses , status ) => {
2205
+ return batchReturned . then ( ( responses ) => {
2203
2206
if ( responses [ index ] . hasOwnProperty ( 'success' ) ) {
2204
2207
const objectId = responses [ index ] . success . objectId ;
2208
+ const status = responses [ index ] . _status ;
2209
+ delete responses [ index ] . _status ;
2205
2210
mapIdForPin [ objectId ] = obj . _localId ;
2206
2211
obj . _handleSaveResponse ( responses [ index ] . success , status ) ;
2207
2212
} else {
@@ -2228,9 +2233,7 @@ const DefaultController = {
2228
2233
return params ;
2229
2234
} )
2230
2235
} , options ) ;
2231
- } ) . then ( ( response , status ) => {
2232
- batchReturned . resolve ( response , status ) ;
2233
- } , ( error ) => {
2236
+ } ) . then ( batchReturned . resolve , ( error ) => {
2234
2237
batchReturned . reject ( new ParseError ( ParseError . INCORRECT_TYPE , error . message ) ) ;
2235
2238
} ) ;
2236
2239
@@ -2258,7 +2261,9 @@ const DefaultController = {
2258
2261
params . path ,
2259
2262
params . body ,
2260
2263
options
2261
- ) . then ( ( response , status ) => {
2264
+ ) . then ( ( response ) => {
2265
+ const status = response . _status ;
2266
+ delete response . _status ;
2262
2267
targetCopy . _handleSaveResponse ( response , status ) ;
2263
2268
} , ( error ) => {
2264
2269
targetCopy . _handleSaveError ( ) ;
0 commit comments