File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -358,8 +358,9 @@ export class BaseDataService<T extends CacheableObject> implements HALDataServic
358358 for ( const object of remoteDataObject . payload . page ) {
359359 if ( hasValue ( object ?. _links ) ) {
360360 for ( const followLinkName of Object . keys ( object . _links ) ) {
361- // only add the followLinks if they are embedded
362- if ( hasValue ( object [ followLinkName ] ) && followLinkName !== 'self' ) {
361+ // only add the followLinks if they are embedded, and we get only links from the linkMap with the correct name
362+ const linkDefinition = getLinkDefinition ( ( remoteDataObject . payload as any ) . constructor , followLinkName ) ;
363+ if ( linkDefinition ?. propertyName && hasValue ( remoteDataObject . payload [ linkDefinition . propertyName ] ) && followLinkName !== 'self' ) {
363364 // followLink can be either an individual HALLink or a HALLink[]
364365 const followLinksList : HALLink [ ] = [ ] . concat ( object . _links [ followLinkName ] ) ;
365366 for ( const individualFollowLink of followLinksList ) {
You can’t perform that action at this time.
0 commit comments