@@ -102,22 +102,20 @@ export class Service extends ParentResourceService implements IService {
102102 } ) ;
103103 resource . is_loading = false ;
104104 return resource ;
105- }
106-
107- // CACHESTORE
108- this . getService ( ) . cachestore . getResource ( resource )
109- . then (
110- success => {
105+ } else {
106+ // CACHESTORE
107+ this . getService ( ) . cachestore . getResource ( resource )
108+ . then ( success => {
111109 if ( Base . isObjectLive ( temporal_ttl , resource . lastupdate ) ) {
112110 this . runFc ( fc_success , { data : success } ) ;
113111 } else {
114112 this . getGetFromServer ( path , fc_success , fc_error , resource ) ;
115113 }
116- } ,
117- error => {
114+ } )
115+ . catch ( error => {
118116 this . getGetFromServer ( path , fc_success , fc_error , resource ) ;
119- }
120- ) ;
117+ } ) ;
118+ }
121119
122120 return resource ;
123121 }
@@ -205,7 +203,8 @@ export class Service extends ParentResourceService implements IService {
205203 } else {
206204 // STORE
207205 tempororay_collection . $is_loading = true ;
208- this . getService ( ) . cachestore . getCollectionFromStorePromise ( path . getForCache ( ) , tempororay_collection )
206+
207+ this . getService ( ) . cachestore . getCollectionFromStorePromise ( path . getForCache ( ) , path . includes , tempororay_collection )
209208 . then (
210209 success => {
211210 tempororay_collection . $source = 'store' ;
@@ -253,7 +252,7 @@ export class Service extends ParentResourceService implements IService {
253252 Converter . build ( success . data , tempororay_collection ) ;
254253
255254 this . getService ( ) . cachememory . setCollection ( path . getForCache ( ) , tempororay_collection ) ;
256- this . getService ( ) . cachestore . setCollection ( path . getForCache ( ) , tempororay_collection ) ;
255+ this . getService ( ) . cachestore . setCollection ( path . getForCache ( ) , tempororay_collection , params . include ) ;
257256
258257 // localfilter getted data
259258 let localfilter = new LocalFilter ( params . localfilter ) ;
@@ -307,8 +306,10 @@ export class Service extends ParentResourceService implements IService {
307306 }
308307
309308 public clearCacheMemory ( ) : boolean {
310- return this . getService ( ) . cachememory . deprecateCollections ( this . type ) &&
311- this . getService ( ) . cachestore . deprecateCollections ( this . type ) ;
309+ let path = new PathBuilder ( ) ;
310+ path . applyParams ( this ) ;
311+ return this . getService ( ) . cachememory . deprecateCollections ( path . getForCache ( ) ) &&
312+ this . getService ( ) . cachestore . deprecateCollections ( path . getForCache ( ) ) ;
312313 }
313314
314315 public parseFromServer ( attributes : IAttributes ) : void {
0 commit comments