File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ class ApiDataFactory extends Helper {
230
230
}
231
231
232
232
_after ( ) {
233
- if ( ! this . config . cleanup ) {
233
+ if ( ! this . config . cleanup || this . config . cleanup === false ) {
234
234
return Promise . resolve ( ) ;
235
235
}
236
236
const promises = [ ] ;
@@ -244,7 +244,6 @@ class ApiDataFactory extends Helper {
244
244
promises . push ( this . _requestDelete ( factoryName , createdItems [ id ] ) ) ;
245
245
}
246
246
}
247
-
248
247
return Promise . all ( promises ) ;
249
248
}
250
249
@@ -379,7 +378,9 @@ Current file error: ${err.message}`);
379
378
380
379
if ( ! request ) {
381
380
const method = Object . keys ( this . factories [ factory ] . delete ) [ 0 ] ;
381
+
382
382
const url = this . factories [ factory ] . delete [ method ] . replace ( '{id}' , id ) ;
383
+
383
384
request = {
384
385
method,
385
386
url,
@@ -388,6 +389,10 @@ Current file error: ${err.message}`);
388
389
389
390
request . baseURL = this . config . endpoint ;
390
391
392
+ if ( request . url . match ( / ^ u n d e f i n e d / ) ) {
393
+ return this . debugSection ( 'Please configure the delete request in your ApiDataFactory helper' , 'delete: () => ({ method: \'DELETE\', url: \'/api/users\' })' ) ;
394
+ }
395
+
391
396
return this . restHelper . _executeRequest ( request ) . then ( ( ) => {
392
397
const idx = this . created [ factory ] . indexOf ( id ) ;
393
398
this . debugSection ( 'Deleted Id' , `Id: ${ id } ` ) ;
You can’t perform that action at this time.
0 commit comments