From afbadf93229645ea192d8d699397e30585764153 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Sun, 20 Aug 2023 15:13:05 +0530 Subject: [PATCH] Add search attribute to redeploy endpoint --- app/controllers/api/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();