From fc6e7739ded3b71d9b062245ff0c8a56af66c763 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 31 Jan 2022 14:30:55 +0400 Subject: [PATCH] feat: review comments --- app/executor.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/executor.php b/app/executor.php index c78ef63d5b..d280f408e6 100644 --- a/app/executor.php +++ b/app/executor.php @@ -936,7 +936,6 @@ App::post('/v1/functions/:functionId/executions') ->action( function (string $trigger, string $projectId, string $executionId, string $functionId, string $event, string $eventData, string $data, array $webhooks, string $userId, string $jwt, Response $response, Database $dbForProject) { $data = execute($trigger, $projectId, $executionId, $functionId, $dbForProject, $event, $eventData, $data, $webhooks, $userId, $jwt); - $response ->setStatusCode(Response::STATUS_CODE_OK) ->json($data); @@ -950,9 +949,10 @@ App::delete('/v1/functions/:functionId') ->inject('dbForProject') ->action( function (string $functionId, Response $response, Database $dbForProject) use ($orchestrationPool) { - /** @var Orchestration $orchestration */ - $orchestration = $orchestrationPool->get(); try { + /** @var Orchestration $orchestration */ + $orchestration = $orchestrationPool->get(); + // Get function document $function = $dbForProject->getDocument('functions', $functionId); @@ -1037,9 +1037,10 @@ App::delete('/v1/deployments/:deploymentId') ->inject('response') ->inject('dbForProject') ->action(function (string $deploymentId, Response $response, Database $dbForProject) use ($orchestrationPool) { - /** @var Orchestration $orchestration */ - $orchestration = $orchestrationPool->get(); try { + /** @var Orchestration $orchestration */ + $orchestration = $orchestrationPool->get(); + // Get deployment document $deployment = $dbForProject->getDocument('deployments', $deploymentId);