mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
68930: add embed query param for followLinks in buildHref + tests
removed fdescribe
This commit is contained in:
@@ -23,6 +23,11 @@ export class FollowLinkConfig<R extends HALResource> {
|
||||
* use on the retrieved object.
|
||||
*/
|
||||
linksToFollow?: Array<FollowLinkConfig<any>>;
|
||||
|
||||
/**
|
||||
* Forward to rest which links we're following, so these can already be embedded
|
||||
*/
|
||||
forwardToRest? = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,15 +41,19 @@ export class FollowLinkConfig<R extends HALResource> {
|
||||
* in a certain way
|
||||
* @param linksToFollow: a list of {@link FollowLinkConfig}s to
|
||||
* use on the retrieved object.
|
||||
* @param forwardToRest: boolean to check whether to forward info on followLinks to rest,
|
||||
* so these can be embedded, default true
|
||||
*/
|
||||
export const followLink = <R extends HALResource>(
|
||||
linkName: keyof R['_links'],
|
||||
findListOptions?: FindListOptions,
|
||||
forwardToRest = true,
|
||||
...linksToFollow: Array<FollowLinkConfig<any>>
|
||||
): FollowLinkConfig<R> => {
|
||||
return {
|
||||
name: linkName,
|
||||
findListOptions,
|
||||
forwardToRest,
|
||||
linksToFollow
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user