@@ -6,11 +6,11 @@ import { Observable } from 'rxjs';
66
77import { NotificationsService } from '../../shared/notifications/notifications.service' ;
88import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model' ;
9- import { dataService } from '../cache/builders/build-decorators' ;
109import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service' ;
1110import { RequestParam } from '../cache/models/request-param.model' ;
1211import { ObjectCacheService } from '../cache/object-cache.service' ;
1312import { CoreState } from '../core-state.model' ;
13+ import { IdentifiableDataService } from '../data/base/identifiable-data.service' ;
1414import { ChangeAnalyzer } from '../data/change-analyzer' ;
1515import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service' ;
1616import { FindListOptions } from '../data/find-list-options.model' ;
@@ -21,7 +21,6 @@ import { UpdateDataServiceImpl } from '../data/update-data.service';
2121import { HALEndpointService } from '../shared/hal-endpoint.service' ;
2222import { NoContent } from '../shared/NoContent.model' ;
2323import { Suggestion } from './models/suggestion.model' ;
24- import { SUGGESTION } from './models/suggestion-objects.resource-type' ;
2524import { SuggestionSource } from './models/suggestion-source.model' ;
2625import { SuggestionTarget } from './models/suggestion-target.model' ;
2726import { SuggestionSourceDataService } from './source/suggestion-source-data.service' ;
@@ -65,8 +64,7 @@ export class SuggestionDataServiceImpl extends UpdateDataServiceImpl<Suggestion>
6564 * The service handling all Suggestion Target REST requests.
6665 */
6766@Injectable ( { providedIn : 'root' } )
68- @dataService ( SUGGESTION )
69- export class SuggestionsDataService {
67+ export class SuggestionsDataService extends IdentifiableDataService < Suggestion > {
7068 protected searchFindBySourceMethod = 'findBySource' ;
7169 protected searchFindByTargetAndSourceMethod = 'findByTargetAndSource' ;
7270
@@ -85,12 +83,11 @@ export class SuggestionsDataService {
8583 */
8684 private suggestionTargetsDataService : SuggestionTargetDataService ;
8785
88- private responseMsToLive = 10 * 1000 ;
89-
9086 /**
9187 * Initialize service variables
9288 * @param {RequestService } requestService
9389 * @param {RemoteDataBuildService } rdbService
90+ * @param {Store } store
9491 * @param {ObjectCacheService } objectCache
9592 * @param {HALEndpointService } halService
9693 * @param {NotificationsService } notificationsService
@@ -102,6 +99,7 @@ export class SuggestionsDataService {
10299 constructor (
103100 protected requestService : RequestService ,
104101 protected rdbService : RemoteDataBuildService ,
102+ protected store : Store < CoreState > ,
105103 protected objectCache : ObjectCacheService ,
106104 protected halService : HALEndpointService ,
107105 protected notificationsService : NotificationsService ,
@@ -110,6 +108,7 @@ export class SuggestionsDataService {
110108 protected comparatorSources : DefaultChangeAnalyzer < SuggestionSource > ,
111109 protected comparatorTargets : DefaultChangeAnalyzer < SuggestionTarget > ,
112110 ) {
111+ super ( 'suggestions' , requestService , rdbService , objectCache , halService ) ;
113112 this . suggestionsDataService = new SuggestionDataServiceImpl ( requestService , rdbService , null , objectCache , halService , notificationsService , http , comparatorSuggestions , this . responseMsToLive ) ;
114113 this . suggestionSourcesDataService = new SuggestionSourceDataService ( requestService , rdbService , null , objectCache , halService , notificationsService , http , comparatorSources ) ;
115114 this . suggestionTargetsDataService = new SuggestionTargetDataService ( requestService , rdbService , null , objectCache , halService , notificationsService , http , comparatorTargets ) ;
0 commit comments