@@ -36,7 +36,7 @@ export class DemoInMemoryBackendService implements InMemoryDbService {
36
36
37
37
post ( reqInfo : any ) {
38
38
const collectionName = reqInfo . collectionName ;
39
- if ( DaffInMemoryBackendCartRootService . COLLECTION_NAMES . indexOf ( collectionName ) > - 1 ) {
39
+ if ( this . cartTestingService . canHandle ( collectionName ) ) {
40
40
return this . cartTestingService . post ( reqInfo ) ;
41
41
} else if ( collectionName === 'auth' ) {
42
42
return this . authTestingService . post ( reqInfo ) ;
@@ -51,7 +51,7 @@ export class DemoInMemoryBackendService implements InMemoryDbService {
51
51
return this . productTestingService . get ( reqInfo ) ;
52
52
} else if ( collectionName === 'navigation' ) {
53
53
return this . navigationTestingService . get ( reqInfo ) ;
54
- } else if ( DaffInMemoryBackendCartRootService . COLLECTION_NAMES . indexOf ( collectionName ) > - 1 ) {
54
+ } else if ( this . cartTestingService . canHandle ( collectionName ) ) {
55
55
return this . cartTestingService . get ( reqInfo ) ;
56
56
} else if ( collectionName === 'countries' ) {
57
57
return this . geographyTestingService . get ( reqInfo ) ;
@@ -62,14 +62,14 @@ export class DemoInMemoryBackendService implements InMemoryDbService {
62
62
63
63
put ( reqInfo : any ) {
64
64
const collectionName = reqInfo . collectionName ;
65
- if ( DaffInMemoryBackendCartRootService . COLLECTION_NAMES . indexOf ( collectionName ) > - 1 ) {
65
+ if ( this . cartTestingService . canHandle ( collectionName ) ) {
66
66
return this . cartTestingService . put ( reqInfo ) ;
67
67
}
68
68
}
69
69
70
70
delete ( reqInfo : any ) {
71
71
const collectionName = reqInfo . collectionName ;
72
- if ( DaffInMemoryBackendCartRootService . COLLECTION_NAMES . indexOf ( collectionName ) > - 1 ) {
72
+ if ( this . cartTestingService . canHandle ( collectionName ) ) {
73
73
return this . cartTestingService . delete ( reqInfo ) ;
74
74
}
75
75
}
0 commit comments