diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index aad527ea7a238d3ffeb9f5dc70c3a8ee25a75ede..8362358d61bdd2c8eec3b5393eb9e1859b448ae8 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -52,7 +52,7 @@ export abstract class DataService<T extends CacheableObject> { /** * Allows subclasses to reset the response cache time. */ - protected resetMsToLive: number; + protected responseMsToLive: number; public abstract getBrowseEndpoint(options: FindAllOptions, linkPath?: string): Observable<string> @@ -134,8 +134,8 @@ export abstract class DataService<T extends CacheableObject> { first((href: string) => hasValue(href))) .subscribe((href: string) => { const request = new FindAllRequest(this.requestService.generateRequestId(), href, options); - if (this.resetMsToLive !== undefined) { - request.responseMsToLive = this.resetMsToLive; + if (hasValue(this.responseMsToLive)) { + request.responseMsToLive = this.responseMsToLive; } this.requestService.configure(request); }); @@ -160,8 +160,8 @@ export abstract class DataService<T extends CacheableObject> { find((href: string) => hasValue(href))) .subscribe((href: string) => { const request = new FindByIDRequest(this.requestService.generateRequestId(), href, id); - if (this.resetMsToLive !== undefined) { - request.responseMsToLive = this.resetMsToLive; + if (hasValue(this.responseMsToLive)) { + request.responseMsToLive = this.responseMsToLive; } this.requestService.configure(request); }); @@ -171,8 +171,8 @@ export abstract class DataService<T extends CacheableObject> { findByHref(href: string, options?: HttpOptions): Observable<RemoteData<T>> { const request = new GetRequest(this.requestService.generateRequestId(), href, null, options); - if (this.resetMsToLive !== undefined) { - request.responseMsToLive = this.resetMsToLive; + if (hasValue(this.responseMsToLive)) { + request.responseMsToLive = this.responseMsToLive; } this.requestService.configure(request); return this.rdbService.buildSingle<T>(href); diff --git a/src/app/core/submission/workflowitem-data.service.ts b/src/app/core/submission/workflowitem-data.service.ts index b64153189258cacbe3fbabd3d66c6425818a3d0b..218de9c81a03e65870262aa6239e9e1d21e4703e 100644 --- a/src/app/core/submission/workflowitem-data.service.ts +++ b/src/app/core/submission/workflowitem-data.service.ts @@ -20,7 +20,7 @@ import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; @Injectable() export class WorkflowItemDataService extends DataService<WorkflowItem> { protected linkPath = 'workflowitems'; - protected resetMsToLive = 0; + protected responseMsToLive = 0; constructor( protected comparator: DSOChangeAnalyzer<WorkflowItem>, diff --git a/src/app/core/submission/workspaceitem-data.service.ts b/src/app/core/submission/workspaceitem-data.service.ts index b49cb065bdc993e5df5e6650684409589ffdc86b..70e07edd5e24b8ad484b3bdd62aee01e273ac3ca 100644 --- a/src/app/core/submission/workspaceitem-data.service.ts +++ b/src/app/core/submission/workspaceitem-data.service.ts @@ -20,7 +20,7 @@ import { WorkspaceItem } from './models/workspaceitem.model'; @Injectable() export class WorkspaceitemDataService extends DataService<WorkspaceItem> { protected linkPath = 'workspaceitems'; - protected resetMsToLive = 0; + protected responseMsToLive = 0; constructor( protected comparator: DSOChangeAnalyzer<WorkspaceItem>, diff --git a/src/app/core/tasks/claimed-task-data.service.ts b/src/app/core/tasks/claimed-task-data.service.ts index 546c4343b619134e038466aceaf1be5cc8e38868..fecffaabe1ccaf958f384d9651e2ea2ac994f45b 100644 --- a/src/app/core/tasks/claimed-task-data.service.ts +++ b/src/app/core/tasks/claimed-task-data.service.ts @@ -22,7 +22,7 @@ import { ProcessTaskResponse } from './models/process-task-response'; @Injectable() export class ClaimedTaskDataService extends TasksService<ClaimedTask> { - protected resetMsToLive = 0; + protected responseMsToLive = 0; /** * The endpoint link name diff --git a/src/app/core/tasks/pool-task-data.service.ts b/src/app/core/tasks/pool-task-data.service.ts index ee3568e5856f7c4af9114b03e9f8d897eb5d730c..62689c4cfcdda62238fcf1629cf928452232c3dc 100644 --- a/src/app/core/tasks/pool-task-data.service.ts +++ b/src/app/core/tasks/pool-task-data.service.ts @@ -27,7 +27,7 @@ export class PoolTaskDataService extends TasksService<PoolTask> { */ protected linkPath = 'pooltasks'; - protected resetMsToLive = 0; + protected responseMsToLive = 0; /** * Initialize instance variables