fix(coolify): use correct /deployments/applications/{uuid} endpoint

Made-with: Cursor
This commit is contained in:
2026-04-21 12:05:51 -07:00
parent 0797717bc1
commit a591c55fc4

View File

@@ -454,7 +454,11 @@ export async function getDeploymentLogs(deploymentUuid: string): Promise<{ logs:
}
export async function listApplicationDeployments(uuid: string): Promise<CoolifyDeployment[]> {
return coolifyFetch(`/applications/${uuid}/deployments`);
// Coolify v4 nests this under /deployments/applications/{uuid}
// and returns { count, deployments }. Normalize to a flat array.
const raw = await coolifyFetch(`/deployments/applications/${uuid}?take=50`);
if (Array.isArray(raw)) return raw as CoolifyDeployment[];
return (raw?.deployments ?? []) as CoolifyDeployment[];
}
// ──────────────────────────────────────────────────