From d70685a5f2f9ac9390294b6fb94450cecba266a8 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Thu, 24 Dec 2020 13:39:37 +0100 Subject: [PATCH] 74647: findByHref and findAllByHref for RootDataService --- src/app/core/data/root-data.service.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/app/core/data/root-data.service.ts b/src/app/core/data/root-data.service.ts index 0b9ac1c145..20949daf50 100644 --- a/src/app/core/data/root-data.service.ts +++ b/src/app/core/data/root-data.service.ts @@ -15,6 +15,8 @@ import { DefaultChangeAnalyzer } from './default-change-analyzer.service'; import { Observable } from 'rxjs'; import { RemoteData } from './remote-data'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; +import { FindListOptions } from './request.models'; +import { PaginatedList } from './paginated-list'; /* tslint:disable:max-classes-per-file */ @@ -68,5 +70,26 @@ export class RootDataService { findRoot(...linksToFollow: Array>): Observable> { return this.dataService.findByHref(this.halService.getRootHref(), ...linksToFollow); } + + /** + * Returns an observable of {@link RemoteData} of an object, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the object + * @param href The url of object we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved + */ + findByHref(href: string, ...linksToFollow: Array>): Observable> { + return this.dataService.findByHref(href, ...linksToFollow); + } + + /** + * Returns a list of observables of {@link RemoteData} of objects, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the object + * @param href The url of object we want to retrieve + * @param findListOptions Find list options object + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved + */ + findAllByHref(href: string, findListOptions: FindListOptions = {}, ...linksToFollow: Array>): Observable>> { + return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow); + } } /* tslint:enable:max-classes-per-file */