mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
DS-3618 fix items link in the BrowseEntryResource
This commit is contained in:
@@ -10,6 +10,7 @@ package org.dspace.app.rest.model.hateoas;
|
||||
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
|
||||
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
|
||||
|
||||
import org.atteo.evo.inflector.English;
|
||||
import org.dspace.app.rest.RestResourceController;
|
||||
import org.dspace.app.rest.model.BrowseEntryRest;
|
||||
import org.dspace.app.rest.model.BrowseIndexRest;
|
||||
@@ -40,7 +41,7 @@ public class BrowseEntryResource extends ResourceSupport {
|
||||
BrowseIndexRest bix = entry.getBrowseIndex();
|
||||
RestResourceController methodOn = methodOn(RestResourceController.class, bix.getCategory(), bix.getType());
|
||||
UriComponentsBuilder uriComponentsBuilder = linkTo(methodOn
|
||||
.findRel(null, bix.getCategory(), bix.getType(), bix.getId(), BrowseIndexRest.ITEMS, null, null, null))
|
||||
.findRel(null, bix.getCategory(), English.plural(bix.getType()), bix.getId(), BrowseIndexRest.ITEMS, null, null, null))
|
||||
.toUriComponentsBuilder();
|
||||
Link link = new Link(addFilterParams(uriComponentsBuilder).build().toString(), BrowseIndexRest.ITEMS);
|
||||
add(link);
|
||||
|
Reference in New Issue
Block a user