mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 19:59:50 +00:00
Navitia: Fix query context builder.
This commit is contained in:
parent
e86fdede13
commit
8dce62c1ab
1 changed files with 15 additions and 4 deletions
|
@ -1077,11 +1077,22 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Fill context.
|
// Fill context.
|
||||||
|
String prevQueryUri = null;
|
||||||
|
String nextQueryUri = null;
|
||||||
final JSONArray links = head.getJSONArray("links");
|
final JSONArray links = head.getJSONArray("links");
|
||||||
final JSONObject prev = links.getJSONObject(0);
|
for (int i = 0; i < links.length(); ++i)
|
||||||
final String prevQueryUri = prev.getString("href");
|
{
|
||||||
final JSONObject next = links.getJSONObject(1);
|
final JSONObject link = links.getJSONObject(i);
|
||||||
final String nextQueryUri = next.getString("href");
|
final String type = link.getString("type");
|
||||||
|
if (type.equals("prev"))
|
||||||
|
{
|
||||||
|
prevQueryUri = link.getString("href");
|
||||||
|
}
|
||||||
|
else if (type.equals("next"))
|
||||||
|
{
|
||||||
|
nextQueryUri = link.getString("href");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final QueryTripsResult result = new QueryTripsResult(resultHeader, queryUri.toString(), from, null, to, new Context(from, to,
|
final QueryTripsResult result = new QueryTripsResult(resultHeader, queryUri.toString(), from, null, to, new Context(from, to,
|
||||||
prevQueryUri, nextQueryUri), new LinkedList<Trip>());
|
prevQueryUri, nextQueryUri), new LinkedList<Trip>());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue