|
1 | 1 | import { ActionFunctionArgs, json } from "@remix-run/server-runtime"; |
2 | | -import { InitializeDeploymentRequestBody } from "@trigger.dev/core/v3"; |
| 2 | +import { InitializeDeploymentRequestBody, InitializeDeploymentResponseBody } from "@trigger.dev/core/v3"; |
| 3 | +import { env } from "~/env.server"; |
3 | 4 | import { authenticateApiRequest } from "~/services/apiAuth.server"; |
4 | 5 | import { logger } from "~/services/logger.server"; |
5 | 6 | import { InitializeDeploymentService } from "~/v3/services/initializeDeployment.server"; |
@@ -31,15 +32,18 @@ export async function action({ request, params }: ActionFunctionArgs) { |
31 | 32 |
|
32 | 33 | const { deployment, imageTag } = await service.call(authenticatedEnv, body.data); |
33 | 34 |
|
| 35 | + const responseBody: InitializeDeploymentResponseBody = { |
| 36 | + id: deployment.friendlyId, |
| 37 | + contentHash: deployment.contentHash, |
| 38 | + shortCode: deployment.shortCode, |
| 39 | + version: deployment.version, |
| 40 | + externalBuildData: deployment.externalBuildData as InitializeDeploymentResponseBody["externalBuildData"], |
| 41 | + imageTag, |
| 42 | + registryHost: env.DEPLOY_REGISTRY_HOST |
| 43 | + } |
| 44 | + |
34 | 45 | return json( |
35 | | - { |
36 | | - id: deployment.friendlyId, |
37 | | - contentHash: deployment.contentHash, |
38 | | - shortCode: deployment.shortCode, |
39 | | - version: deployment.version, |
40 | | - externalBuildData: deployment.externalBuildData, |
41 | | - imageTag, |
42 | | - }, |
| 46 | + responseBody, |
43 | 47 | { status: 200 } |
44 | 48 | ); |
45 | 49 | } |
0 commit comments