mirror of
https://github.com/dancojocaru2000/foxbank.git
synced 2025-02-22 23:39:36 +02:00
Fixed /accounts/... response
This commit is contained in:
parent
17d1cb2400
commit
02cf164620
1 changed files with 6 additions and 0 deletions
|
@ -35,10 +35,15 @@ def get_valid_account_types():
|
|||
return returns.success(account_types=ACCOUNT_TYPES)
|
||||
|
||||
|
||||
class AccountResponseSchema(returns.SuccessSchema):
|
||||
account = fields.Nested(Account.Schema)
|
||||
|
||||
|
||||
@bp.get('/<int:account_id>')
|
||||
@ensure_logged_in
|
||||
@bp.response(401, returns.ErrorSchema, description='Login failure')
|
||||
@bp.doc(security=[{'Token': []}])
|
||||
@bp.response(200, AccountResponseSchema)
|
||||
def get_account_id(account_id: int):
|
||||
"""Get account by id"""
|
||||
account = db_utils.get_account(account_id=account_id)
|
||||
|
@ -54,6 +59,7 @@ def get_account_id(account_id: int):
|
|||
@ensure_logged_in
|
||||
@bp.response(401, returns.ErrorSchema, description='Login failure')
|
||||
@bp.doc(security=[{'Token': []}])
|
||||
@bp.response(200, AccountResponseSchema)
|
||||
def get_account_iban(iban: str):
|
||||
"""Get account by IBAN"""
|
||||
account = db_utils.get_account(iban=iban)
|
||||
|
|
Loading…
Add table
Reference in a new issue