Skip to content

Commit

Permalink
Fix: API - wrong object key in json response when returning errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Licari committed Mar 11, 2024
1 parent 54f51fa commit 7214aa7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _ask(request_data, validate_captcha=True, access_key=None):
access_key=access_key)
ok = validator.validate()
if not ok:
return jsonify(message=validator.errors), validator.http_return_code
return jsonify(errors=validator.errors), validator.http_return_code

# convert amount to wei format
amount_wei = Web3.to_wei(validator.amount, 'ether')
Expand Down
1 change: 1 addition & 0 deletions api/tests/test_api_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_ask_route_parameters(self):
'tokenAddress': ERC20_TOKEN_ADDRESS
})
self.assertEqual(response.status_code, 429)
self.assertIn('errors', response.get_json().keys())


if __name__ == '__main__':
Expand Down

0 comments on commit 7214aa7

Please sign in to comment.