issue 964 properly impl getEntityTypeByLabel

This commit is contained in:
Andrew Wood
2020-12-07 16:21:51 -05:00
parent 39582c9243
commit 10e09b69be

View File

@@ -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) + '');
} }
} }