1
0
Fork 0
mirror of synced 2024-06-15 09:14:50 +12:00

Use execution directly

This commit is contained in:
Bradley Schofield 2022-02-24 13:22:20 +00:00
parent 06448bbdc5
commit b2217f6950
2 changed files with 1 additions and 13 deletions

View file

@ -968,19 +968,9 @@ App::post('/v1/functions/:functionId/executions')
Authorization::skip(fn() => $dbForProject->updateDocument('executions', $executionId, $execution));
$executionResponse['$id'] = $executionId;
$executionResponse['$read'] = $execution->getAttribute('$read', []);
$executionResponse['$write'] = $execution->getAttribute('$write', []);
$executionResponse['functionId'] = $function->getId();
$executionResponse['dateCreated'] = $execution->getAttribute('dateCreated');
$executionResponse['trigger'] = $execution->getAttribute('trigger');
$executionResponse['status'] = $execution->getAttribute('status');
$executionResponse['statusCode'] = $execution->getAttribute('statusCode');
$executionResponse['time'] = $execution->getAttribute('time');
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
->dynamic(new Document($executionResponse), Response::MODEL_EXECUTION);
->dynamic($execution, Response::MODEL_EXECUTION);
});
App::get('/v1/functions/:functionId/executions')

View file

@ -31,7 +31,6 @@ use Appwrite\Utopia\Response\Model\Domain;
use Appwrite\Utopia\Response\Model\Error;
use Appwrite\Utopia\Response\Model\ErrorDev;
use Appwrite\Utopia\Response\Model\Execution;
use Appwrite\Utopia\Response\Model\SyncExecution;
use Appwrite\Utopia\Response\Model\Build;
use Appwrite\Utopia\Response\Model\File;
use Appwrite\Utopia\Response\Model\Bucket;
@ -267,7 +266,6 @@ class Response extends SwooleResponse
->setModel(new Runtime())
->setModel(new Deployment())
->setModel(new Execution())
->setModel(new SyncExecution())
->setModel(new Build())
->setModel(new Project())
->setModel(new Webhook())