Mappings enhancement
This commit is contained in:
parent
1d7c4c2dfd
commit
2dec6d5384
1 changed files with 5 additions and 1 deletions
|
|
@ -19,6 +19,10 @@ async def root():
|
|||
@cbv(router)
|
||||
class APIv1:
|
||||
webhook_service: WebhookProcessor = Depends(AutowireSupport.webhook_processor)
|
||||
logger = __import__('logging').getLogger(__name__)
|
||||
|
||||
def __init__(self):
|
||||
mapper.add(Request, WebhookEvent)
|
||||
|
||||
@router.get("/health", summary="Health check")
|
||||
async def health(self) -> JSONResponse:
|
||||
|
|
@ -26,5 +30,5 @@ class APIv1:
|
|||
|
||||
@router.post("/ci", summary="CI Webhook")
|
||||
async def ci(self, request: Request):
|
||||
self.webhook_service.process_ci_event(mapper.to(WebhookEvent).map(request))
|
||||
self.webhook_service.process_ci_event(mapper.map(request))
|
||||
return Response(status_code=201)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue