Skip to content

Commit

Permalink
🎨 accept reject reason sa body instead of param
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Oct 16, 2024
1 parent 1de0a29 commit 286725b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/routes/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ async def accept_did_exchange_request(
)
async def reject_did_exchange(
connection_id: str,
reason: Optional[str] = None,
body: Optional[DIDXRejectRequest] = None,
auth: AcaPyAuth = Depends(acapy_auth_from_header),
) -> Connection:
"""
Expand All @@ -443,14 +443,12 @@ async def reject_did_exchange(
bound_logger = logger.bind(body={"connection_id": connection_id})
bound_logger.debug("POST request received: Reject DID exchange")

reject_request_body = DIDXRejectRequest(reason=reason) if reason else None

async with client_from_auth(auth) as aries_controller:
connection_record = await handle_acapy_call(
logger=bound_logger,
acapy_call=aries_controller.did_exchange.reject,
conn_id=connection_id,
body=reject_request_body,
body=body,
)

result = conn_record_to_connection(connection_record)
Expand Down

0 comments on commit 286725b

Please sign in to comment.