mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
followlinks
This commit is contained in:
20
src/app/shared/utils/follow-link-config.model.ts
Normal file
20
src/app/shared/utils/follow-link-config.model.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { FindListOptions } from '../../core/data/request.models';
|
||||
import { HALResource } from '../../core/shared/hal-resource.model';
|
||||
|
||||
export class FollowLinkConfig<R extends HALResource> {
|
||||
name: keyof R['_links'];
|
||||
findListOptions?: FindListOptions;
|
||||
linksToFollow?: Array<FollowLinkConfig<any>>;
|
||||
}
|
||||
|
||||
export const followLink = <R extends HALResource>(
|
||||
linkName: keyof R['_links'],
|
||||
findListOptions?: FindListOptions,
|
||||
...linksToFollow: Array<FollowLinkConfig<any>>
|
||||
): FollowLinkConfig<R> => {
|
||||
return {
|
||||
name: linkName,
|
||||
findListOptions,
|
||||
linksToFollow
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user