Skip to content

Commit f0555ef

Browse files
committed
Fixed bug in merging routes method
1 parent 2e396aa commit f0555ef

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

examples/routes/merge_routes.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,9 @@ def main(api_key):
2020
if isinstance(response, dict) and 'errors' in response.keys():
2121
print('. '.join(response['errors']))
2222
else:
23-
print('Optimization Problem ID: {}'.format(
24-
response['optimization_problem_id']
23+
print('Optimization Problem ID: {} - Status: {}'.format(
24+
response['optimization_problem_id'], response['status']
2525
))
26-
print('Route ID: {}'.format(response['route_id']))
27-
for i, address in enumerate(response['addresses']):
28-
print('Address #{}'.format(i + 1))
29-
print('\tAddress: {0}'.format(address['address']))
30-
print('\tRoute Destination ID: {0}'.format(
31-
address['route_destination_id']
32-
))
3326

3427

3528
if __name__ == '__main__':

route4me/route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def merge_routes(self, **kwargs):
288288
if self.check_required_params(kwargs, ['route_ids']):
289289
response = self.api._request_post(MERGE_ROUTES_HOST,
290290
self.params,
291-
json=kwargs)
291+
data=kwargs)
292292
return response.json()
293293

294294
else:

0 commit comments

Comments
 (0)