diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index c2c4be2d07..3e390d47a7 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1299,12 +1299,15 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId') throw new Exception(Exception::BUILD_NOT_FOUND); } + $deploymentId = ID::unique(); + $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ - '$id' => ID::unique(), + '$id' => $deploymentId, 'buildId' => '', 'buildInternalId' => '', 'entrypoint' => $function->getAttribute('entrypoint'), 'commands' => $function->getAttribute('commands', ''), + 'search' => implode(' ', [$deploymentId, $function->getAttribute('entrypoint')]), ])); $buildEvent = new Build();