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);