diff --git a/src/lib/dokploy.ts b/src/lib/dokploy.ts index ce9c5e5..8b99b93 100644 --- a/src/lib/dokploy.ts +++ b/src/lib/dokploy.ts @@ -214,10 +214,13 @@ export function createDokployClient(config: DokployConfig) { } async function deployApplication(applicationId: string): Promise<{ jobId?: string; status: string }> { - const res = await call<{ jobId?: string; deployId?: string; status?: string }>('/application.deploy', { + const res = await call | null>('/application.deploy', { applicationId, }) - return { jobId: res.jobId ?? res.deployId, status: res.status ?? 'deploying' } + if (!res) return { jobId: undefined, status: 'deploying' } + const jobId = (res.jobId as string) ?? (res.deployId as string) ?? (res.id as string) + const status = (res.status as string) ?? 'deploying' + return { jobId, status } } async function getApplication(applicationId: string): Promise {