Updates
This commit is contained in:
parent
70e4bd844e
commit
294e0e7469
1 changed files with 4 additions and 0 deletions
|
@ -42,10 +42,12 @@ Server::setResource('execute', function () {
|
|||
|
||||
$user ??= new Document();
|
||||
$functionId = $function->getId();
|
||||
$functionInternalId = $function->getInternalId();
|
||||
$deploymentId = $function->getAttribute('deployment', '');
|
||||
|
||||
/** Check if deployment exists */
|
||||
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
||||
$deploymentInternalId = $deployment->getInternalId();
|
||||
|
||||
if ($deployment->getAttribute('resourceId') !== $functionId) {
|
||||
throw new Exception('Deployment not found. Create deployment before trying to execute a function');
|
||||
|
@ -82,6 +84,8 @@ Server::setResource('execute', function () {
|
|||
'$id' => $executionId,
|
||||
'$permissions' => $user->isEmpty() ? [] : [Permission::read(Role::user($user->getId()))],
|
||||
'functionId' => $functionId,
|
||||
'functionInternalId' => $functionInternalId,
|
||||
'deploymentInternalId' => $deploymentInternalId,
|
||||
'deploymentId' => $deploymentId,
|
||||
'trigger' => $trigger,
|
||||
'status' => 'waiting',
|
||||
|
|
Loading…
Reference in a new issue