From ca7f222640e96024564e792a812c9dbff3cd50ad Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Wed, 29 May 2024 12:55:14 -0400 Subject: [PATCH] feat: Adding cli to the function deployment type --- app/controllers/api/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 670ca2f99e..3c8022fde4 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1163,6 +1163,7 @@ App::post('/v1/functions/:functionId/deployments') } $activate = (bool) filter_var($activate, FILTER_VALIDATE_BOOLEAN); + $type = $request->getHeader('x-sdk-language') === 'cli' ? 'cli' : 'manual'; if ($chunksUploaded === $chunks) { if ($activate) { @@ -1200,7 +1201,7 @@ App::post('/v1/functions/:functionId/deployments') 'search' => implode(' ', [$deploymentId, $entrypoint]), 'activate' => $activate, 'metadata' => $metadata, - 'type' => 'manual' + 'type' => $type ])); } else { $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment->setAttribute('size', $fileSize)->setAttribute('metadata', $metadata)); @@ -1233,7 +1234,7 @@ App::post('/v1/functions/:functionId/deployments') 'search' => implode(' ', [$deploymentId, $entrypoint]), 'activate' => $activate, 'metadata' => $metadata, - 'type' => 'manual' + 'type' => $type ])); } else { $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment->setAttribute('chunksUploaded', $chunksUploaded)->setAttribute('metadata', $metadata));