mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user