Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
lincmba committed Apr 5, 2024
1 parent 1a6bcd0 commit 89ff28d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,19 @@ Example:
[GET] /List?_id=<some-id>&_count=<page-size>&_page=<page-number>&_sort=<some-sort>
```

##### LocationHierarchy list mode

The LocationHierarchy endpoint supports two response formats: tree and list. By
default, the response format remains a tree, providing hierarchical location
data. In addition, clients can request the endpoint to return location resources
in a flat list format by providing a request parameter `mode=list`.

Example:

```
[GET] /LocationHierarchy?identifier=<some-location-id>&mode=list&_count=<page-size>&_page=<page-number>&_sort=<some-sort>
```

#### Important Note:

Developers, please update your client applications accordingly to accommodate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ public static Bundle addPaginationLinks(
Map<String, String[]> parameters) {
resultBundle.setTotal(totalEntries);

// add pagination links
int nextPage = page < ((float)totalEntries / count) ? page + 1 : 0; // 0 indicates no next page
int nextPage =
page < ((float) totalEntries / count) ? page + 1 : 0; // 0 indicates no next page
int prevPage = page > 1 ? page - 1 : 0; // 0 indicates no previous page

Bundle.BundleLinkComponent selfLink = new Bundle.BundleLinkComponent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public void testGetPaginatedLocationsPaginatesLocations() {
"http://test:8080/LocationHierarchy?identifier=12345&_page=2&_count=2",
resultBundle.getLink("self").getUrl());
Assert.assertEquals(
"http://test:8080/LocationHierarchy?identifier=12345&_page=3&_count=2",
resultBundle.getLink("next").getUrl());
"http://test:8080/LocationHierarchy?identifier=12345&_page=3&_count=2",
resultBundle.getLink("next").getUrl());
}

private Bundle getLocationBundle() {
Expand Down

0 comments on commit 89ff28d

Please sign in to comment.