DATAREST-762 - Collection resource's base link now forwards parameters.

We now use the current request's URI as base link for all links created for a collection resource. This especially has effect in the creation of pagination links as we now carry potentially applied critierias (induced by our Querydsl based filtering support) forward to the navigation links generated.
This commit is contained in:
Oliver Drotbohm
2020-03-27 11:54:18 +01:00
parent 4c17d54e9a
commit db5995eee0
3 changed files with 54 additions and 4 deletions

View File

@@ -203,8 +203,7 @@ class RepositoryEntityController extends AbstractRepositoryRestController implem
: invoker.invokeFindAll(sort);
ResourceMetadata metadata = resourceInformation.getResourceMetadata();
Optional<Link> baseLink = Optional.of(entityLinks.linkToPagedResource(resourceInformation.getDomainType(),
pageable.isDefault() ? null : pageable.getPageable()));
Optional<Link> baseLink = Optional.of(getDefaultSelfLink());
return toCollectionModel(results, assembler, metadata.getDomainType(), baseLink)
.add(getCollectionResourceLinks(resourceInformation, pageable));