From 10e09b69be183a893b094c49dac235f8e34c4879 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Mon, 7 Dec 2020 16:21:51 -0500 Subject: [PATCH] issue 964 properly impl getEntityTypeByLabel --- src/app/core/data/entity-type.service.ts | 28 ++++-------------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/app/core/data/entity-type.service.ts b/src/app/core/data/entity-type.service.ts index 43a9e3fce6..9971694f4b 100644 --- a/src/app/core/data/entity-type.service.ts +++ b/src/app/core/data/entity-type.service.ts @@ -88,30 +88,10 @@ export class EntityTypeService extends DataService { * @param label */ getEntityTypeByLabel(label: string): Observable> { - - // TODO: Remove mock data once REST API supports this - /* - href$.pipe(take(1)).subscribe((href) => { - const request = new GetRequest(this.requestService.generateRequestId(), href); - this.requestService.configure(request); + let endPoint; + this.halService.getEndpoint(this.linkPath).pipe(take(1)).subscribe((result) => { + endPoint = result; }); - - return this.rdbService.buildSingle(href$); - */ - - // Mock: - const index = [ - 'Publication', - 'Person', - 'Project', - 'OrgUnit', - 'Journal', - 'JournalVolume', - 'JournalIssue', - 'DataPackage', - 'DataFile', - ].indexOf(label); - - return this.findById((index + 1) + ''); + return this.findByHref(endPoint + '/label/' + label); } }