Use confirmation banner for revoking API keys

Currently revoking an API key takes you to a separate page. It should
work the same way as other destructive actions, ie staying on the same
page but with a banner asking you to confirm the action.
This commit is contained in:
Chris Hill-Scott
2017-07-24 15:36:38 +01:00
parent d51ffe6b39
commit 40e79c6827
4 changed files with 40 additions and 42 deletions

View File

@@ -110,8 +110,9 @@ def revoke_api_key(service_id, key_id):
key_name = api_key_api_client.get_api_keys(service_id=service_id, key_id=key_id)['apiKeys'][0]['name']
if request.method == 'GET':
return render_template(
'views/api/keys/revoke.html',
key_name=key_name
'views/api/keys.html',
revoke_key=key_name,
keys=api_key_api_client.get_api_keys(service_id=service_id)['apiKeys'],
)
elif request.method == 'POST':
api_key_api_client.revoke_api_key(service_id=service_id, key_id=key_id)