forked from hazza/dspace-angular
issue 964 properly impl getEntityTypeByLabel
This commit is contained in:
@@ -88,30 +88,10 @@ export class EntityTypeService extends DataService<ItemType> {
|
|||||||
* @param label
|
* @param label
|
||||||
*/
|
*/
|
||||||
getEntityTypeByLabel(label: string): Observable<RemoteData<ItemType>> {
|
getEntityTypeByLabel(label: string): Observable<RemoteData<ItemType>> {
|
||||||
|
let endPoint;
|
||||||
// TODO: Remove mock data once REST API supports this
|
this.halService.getEndpoint(this.linkPath).pipe(take(1)).subscribe((result) => {
|
||||||
/*
|
endPoint = result;
|
||||||
href$.pipe(take(1)).subscribe((href) => {
|
|
||||||
const request = new GetRequest(this.requestService.generateRequestId(), href);
|
|
||||||
this.requestService.configure(request);
|
|
||||||
});
|
});
|
||||||
|
return this.findByHref(endPoint + '/label/' + label);
|
||||||
return this.rdbService.buildSingle<EntityType>(href$);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Mock:
|
|
||||||
const index = [
|
|
||||||
'Publication',
|
|
||||||
'Person',
|
|
||||||
'Project',
|
|
||||||
'OrgUnit',
|
|
||||||
'Journal',
|
|
||||||
'JournalVolume',
|
|
||||||
'JournalIssue',
|
|
||||||
'DataPackage',
|
|
||||||
'DataFile',
|
|
||||||
].indexOf(label);
|
|
||||||
|
|
||||||
return this.findById((index + 1) + '');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user