Use execution directly
This commit is contained in:
parent
06448bbdc5
commit
b2217f6950
|
@ -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')
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue