Skip to content

Commit

Permalink
Added route to retrieve event log.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhakim87 committed Jul 9, 2020
1 parent c5fecf8 commit 8cefb80
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions microsetta_private_api/admin/admin_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ def create_kits(body, token_info):
return jsonify(kits), 201


def get_account_events(account_id, token_info):
validate_admin_access(token_info)

with Transaction() as t:
events = EventLogRepo(t).get_events_by_account(account_id)
return jsonify([x.to_api() for x in events]), 200


def send_email(body, token_info):
validate_admin_access(token_info)

Expand Down
14 changes: 14 additions & 0 deletions microsetta_private_api/api/microsetta_private_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,20 @@ paths:
application/json:
schema:
type: object
'/admin/events/accounts/{account_id}':
get:
operationId: microsetta_private_api.admin.admin_impl.get_account_events
tags:
- Admin
parameters:
- $ref: '#/components/parameters/account_id'
responses:
'200':
description: Event log associated with the account
content:
application/json:
schema:
type: array
'/admin/email':
post:
operationId: microsetta_private_api.admin.admin_impl.send_email
Expand Down

0 comments on commit 8cefb80

Please sign in to comment.