forked from hazza/dspace-angular
bug fixing
This commit is contained in:
@@ -7,6 +7,9 @@ import { SubmissionObject } from './models/submission-object.model';
|
||||
import { SubmissionScopeType } from './submission-scope-type';
|
||||
import { WorkflowItemDataService } from './workflowitem-data.service';
|
||||
import { WorkspaceitemDataService } from './workspaceitem-data.service';
|
||||
import { DataService } from '../data/data.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
|
||||
/**
|
||||
* A service to retrieve submission objects (WorkspaceItem/WorkflowItem)
|
||||
@@ -19,10 +22,22 @@ export class SubmissionObjectDataService {
|
||||
constructor(
|
||||
private workspaceitemDataService: WorkspaceitemDataService,
|
||||
private workflowItemDataService: WorkflowItemDataService,
|
||||
private submissionService: SubmissionService
|
||||
private submissionService: SubmissionService,
|
||||
private halService: HALEndpointService
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the HREF for a specific object based on its identifier
|
||||
* @param id The identifier for the object
|
||||
*/
|
||||
getHrefByID(id): Observable<string> {
|
||||
const dataService: DataService<SubmissionObject> = this.submissionService.getSubmissionScope() === SubmissionScopeType.WorkspaceItem ? this.workspaceitemDataService : this.workflowItemDataService;
|
||||
|
||||
return this.halService.getEndpoint(dataService.getLinkPath()).pipe(
|
||||
map((endpoint: string) => dataService.getIDHref(endpoint, encodeURIComponent(id))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a submission object based on its ID.
|
||||
*
|
||||
|
Reference in New Issue
Block a user