From b9cebae5611a2c6efea03c3e73529903725a9cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 3 Jul 2024 17:14:59 +0200 Subject: [PATCH] Fix activate param --- app/controllers/api/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index d2a1790d94..f9a64db387 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1065,9 +1065,9 @@ App::post('/v1/functions/:functionId/deployments') ->inject('deviceForFunctions') ->inject('deviceForLocal') ->inject('queueForBuilds') - ->action(function (string $functionId, ?string $entrypoint, ?string $commands, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds) { + ->action(function (string $functionId, ?string $entrypoint, ?string $commands, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds) { - $activate = filter_var($activate, FILTER_VALIDATE_BOOLEAN); + $activate = !(\is_bool($activate)) ? ($activate === 'true') : $activate; $function = $dbForProject->getDocument('functions', $functionId);