1
0
Fork 0
mirror of synced 2024-07-05 14:40:42 +12:00

feat: review comments

This commit is contained in:
Christy Jacob 2022-01-31 14:30:55 +04:00
parent 4a405323cb
commit fc6e7739de

View file

@ -936,7 +936,6 @@ App::post('/v1/functions/:functionId/executions')
->action( ->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) { 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); $data = execute($trigger, $projectId, $executionId, $functionId, $dbForProject, $event, $eventData, $data, $webhooks, $userId, $jwt);
$response $response
->setStatusCode(Response::STATUS_CODE_OK) ->setStatusCode(Response::STATUS_CODE_OK)
->json($data); ->json($data);
@ -950,9 +949,10 @@ App::delete('/v1/functions/:functionId')
->inject('dbForProject') ->inject('dbForProject')
->action( ->action(
function (string $functionId, Response $response, Database $dbForProject) use ($orchestrationPool) { function (string $functionId, Response $response, Database $dbForProject) use ($orchestrationPool) {
/** @var Orchestration $orchestration */
$orchestration = $orchestrationPool->get();
try { try {
/** @var Orchestration $orchestration */
$orchestration = $orchestrationPool->get();
// Get function document // Get function document
$function = $dbForProject->getDocument('functions', $functionId); $function = $dbForProject->getDocument('functions', $functionId);
@ -1037,9 +1037,10 @@ App::delete('/v1/deployments/:deploymentId')
->inject('response') ->inject('response')
->inject('dbForProject') ->inject('dbForProject')
->action(function (string $deploymentId, Response $response, Database $dbForProject) use ($orchestrationPool) { ->action(function (string $deploymentId, Response $response, Database $dbForProject) use ($orchestrationPool) {
/** @var Orchestration $orchestration */
$orchestration = $orchestrationPool->get();
try { try {
/** @var Orchestration $orchestration */
$orchestration = $orchestrationPool->get();
// Get deployment document // Get deployment document
$deployment = $dbForProject->getDocument('deployments', $deploymentId); $deployment = $dbForProject->getDocument('deployments', $deploymentId);