forked from hazza/dspace-angular
Merge branch 'followlink-refactor' into metadata-and-relationships-combined-in-submission
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { of as observableOf, Observable } from 'rxjs';
|
||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||
import { SubmissionService } from '../../submission/submission.service';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { RemoteDataError } from '../data/remote-data-error';
|
||||
@@ -42,13 +43,14 @@ export class SubmissionObjectDataService {
|
||||
* Retrieve a submission object based on its ID.
|
||||
*
|
||||
* @param id The identifier of a submission object
|
||||
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved
|
||||
*/
|
||||
findById(id: string): Observable<RemoteData<SubmissionObject>> {
|
||||
findById(id: string, ...linksToFollow: Array<FollowLinkConfig<SubmissionObject>>): Observable<RemoteData<SubmissionObject>> {
|
||||
switch (this.submissionService.getSubmissionScope()) {
|
||||
case SubmissionScopeType.WorkspaceItem:
|
||||
return this.workspaceitemDataService.findById(id);
|
||||
return this.workspaceitemDataService.findById(id,...linksToFollow);
|
||||
case SubmissionScopeType.WorkflowItem:
|
||||
return this.workflowItemDataService.findById(id);
|
||||
return this.workflowItemDataService.findById(id,...linksToFollow);
|
||||
default:
|
||||
const error = new RemoteDataError(
|
||||
undefined,
|
||||
|
Reference in New Issue
Block a user