File tree Expand file tree Collapse file tree
src/app/core/cache/builders Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,7 +112,16 @@ export class LinkService {
112112 * @param linkToFollow the {@link FollowLinkConfig} to resolve
113113 */
114114 public resolveLink < T extends HALResource > ( model , linkToFollow : FollowLinkConfig < T > ) : T {
115- model [ linkToFollow . name ] = this . resolveLinkWithoutAttaching ( model , linkToFollow ) ;
115+ const linkDefinitions = this . getLinkDefinitions ( model . constructor as GenericConstructor < T > ) ;
116+ const linkDef = linkDefinitions . get ( linkToFollow . name ) ;
117+
118+ if ( isNotEmpty ( linkDef ) ) {
119+ // If link exist in definition we can resolve it and use a real property name
120+ model [ linkDef . propertyName ] = this . resolveLinkWithoutAttaching ( model , linkToFollow ) ;
121+ } else {
122+ // For some links we don't have a definition, so we use the link name as property name
123+ model [ linkToFollow . name ] = this . resolveLinkWithoutAttaching ( model , linkToFollow ) ;
124+ }
116125 return model ;
117126 }
118127
You can’t perform that action at this time.
0 commit comments