diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 075dfc6499..268f2b06d5 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -967,11 +967,10 @@ App::post('/v1/functions/:functionId/executions') } Authorization::skip(fn() => $dbForProject->updateDocument('executions', $executionId, $execution)); - $executionResponse['response'] = ($executionResponse['status'] !== 'completed') ? $executionResponse['stderr'] : $executionResponse['stdout']; $response ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic(new Document($executionResponse), Response::MODEL_SYNC_EXECUTION); + ->dynamic($execution, Response::MODEL_EXECUTION); }); App::get('/v1/functions/:functionId/executions') diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 32375af358..4d67302f38 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -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; @@ -156,7 +155,6 @@ class Response extends SwooleResponse const MODEL_DEPLOYMENT = 'deployment'; const MODEL_DEPLOYMENT_LIST = 'deploymentList'; const MODEL_EXECUTION = 'execution'; - const MODEL_SYNC_EXECUTION = 'syncExecution'; const MODEL_EXECUTION_LIST = 'executionList'; const MODEL_BUILD = 'build'; const MODEL_BUILD_LIST = 'buildList'; @@ -268,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()) diff --git a/src/Appwrite/Utopia/Response/Model/SyncExecution.php b/src/Appwrite/Utopia/Response/Model/SyncExecution.php deleted file mode 100644 index 05220f78fd..0000000000 --- a/src/Appwrite/Utopia/Response/Model/SyncExecution.php +++ /dev/null @@ -1,53 +0,0 @@ -addRule('status', [ - 'type' => self::TYPE_STRING, - 'description' => 'Execution Status.', - 'default' => '', - 'example' => 'completed', - ]) - ->addRule('response', [ - 'type' => self::TYPE_STRING, - 'description' => 'Execution Response.', - 'default' => '', - 'example' => 'Hello World!', - ]) - ->addRule('time', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'Execution Time.', - 'default' => 0, - 'example' => 100, - ]) - ; - } - - /** - * Get Name - * - * @return string - */ - public function getName():string - { - return 'Syncronous Execution'; - } - - /** - * Get Collection - * - * @return string - */ - public function getType():string - { - return Response::MODEL_SYNC_EXECUTION; - } -} \ No newline at end of file