Browse Source

Fixed /accounts/... response

pull/5/head
Kenneth Bruen 3 years ago
parent
commit
02cf164620
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 6
      server/foxbank_server/apis/accounts.py

6
server/foxbank_server/apis/accounts.py

@ -35,10 +35,15 @@ def get_valid_account_types():
return returns.success(account_types=ACCOUNT_TYPES) return returns.success(account_types=ACCOUNT_TYPES)
class AccountResponseSchema(returns.SuccessSchema):
account = fields.Nested(Account.Schema)
@bp.get('/<int:account_id>') @bp.get('/<int:account_id>')
@ensure_logged_in @ensure_logged_in
@bp.response(401, returns.ErrorSchema, description='Login failure') @bp.response(401, returns.ErrorSchema, description='Login failure')
@bp.doc(security=[{'Token': []}]) @bp.doc(security=[{'Token': []}])
@bp.response(200, AccountResponseSchema)
def get_account_id(account_id: int): def get_account_id(account_id: int):
"""Get account by id""" """Get account by id"""
account = db_utils.get_account(account_id=account_id) account = db_utils.get_account(account_id=account_id)
@ -54,6 +59,7 @@ def get_account_id(account_id: int):
@ensure_logged_in @ensure_logged_in
@bp.response(401, returns.ErrorSchema, description='Login failure') @bp.response(401, returns.ErrorSchema, description='Login failure')
@bp.doc(security=[{'Token': []}]) @bp.doc(security=[{'Token': []}])
@bp.response(200, AccountResponseSchema)
def get_account_iban(iban: str): def get_account_iban(iban: str):
"""Get account by IBAN""" """Get account by IBAN"""
account = db_utils.get_account(iban=iban) account = db_utils.get_account(iban=iban)

Loading…
Cancel
Save