Skip to content

Commit 5f74c29

Browse files
artlowelalexandrevryghem
authored andcommitted
fix issue where relationship lists wouldn't update automatically from the second submit onwards
(cherry picked from commit 4541788)
1 parent fda14ac commit 5f74c29

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/app/core/data/relationship-data.service.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,19 @@ export class RelationshipDataService extends IdentifiableDataService<Relationshi
350350
} else {
351351
findListOptions.searchParams = searchParams;
352352
}
353-
const result$ = this.searchBy('byLabel', findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
353+
354+
// always set reRequestOnStale to false here, so it doesn't happen automatically in BaseDataService
355+
const result$ = this.searchBy('byLabel', findListOptions, useCachedVersionIfAvailable, false, ...linksToFollow);
354356

355357
// add this result as a dependency of the item, meaning that if the item is invalided, this
356358
// result will be as well
357-
this.addDependency(result$, item.self);
359+
this.addDependency(result$, item._links.self.href);
358360

359-
return result$;
361+
// do the reRequestOnStale call here, to ensure any re-requests also get added as dependencies
362+
return result$.pipe(
363+
this.reRequestStaleRemoteData(reRequestOnStale, () =>
364+
this.getItemRelationshipsByLabel(item, label, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow)),
365+
);
360366
}
361367

362368
/**

0 commit comments

Comments
 (0)