From 3fafefb2c29746709989ef15d65d60c809b102c8 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:01:31 +0530 Subject: [PATCH] Fixed automatic activation of manual deployments --- app/controllers/api/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 8ae1ec4469..cafa6c3893 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -915,7 +915,9 @@ App::post('/v1/functions/:functionId/deployments') ->inject('project') ->inject('deviceFunctions') ->inject('deviceLocal') - ->action(function (string $functionId, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { + ->action(function (string $functionId, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { + $activate = filter_var($activate, FILTER_VALIDATE_BOOLEAN); + $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) {