fix(coolify): use /deploy?uuid=... endpoint (Coolify v4)
Made-with: Cursor
This commit is contained in:
@@ -429,8 +429,18 @@ export async function listApplications(): Promise<CoolifyApplication[]> {
|
|||||||
return coolifyFetch('/applications');
|
return coolifyFetch('/applications');
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deployApplication(uuid: string): Promise<{ deployment_uuid: string }> {
|
export async function deployApplication(uuid: string, opts: { force?: boolean } = {}): Promise<{ deployment_uuid: string }> {
|
||||||
return coolifyFetch(`/applications/${uuid}/deploy`, { method: 'POST' });
|
// Coolify v4 exposes deploy as POST /deploy?uuid=...&force=...
|
||||||
|
// The older /applications/{uuid}/deploy path is a 404 on current
|
||||||
|
// Coolify releases.
|
||||||
|
const q = new URLSearchParams({ uuid });
|
||||||
|
if (opts.force) q.set('force', 'true');
|
||||||
|
const res = await coolifyFetch(`/deploy?${q.toString()}`, { method: 'POST' });
|
||||||
|
// Response shape: { deployments: [{ deployment_uuid, ... }] } or direct object.
|
||||||
|
const first = Array.isArray(res?.deployments) ? res.deployments[0] : res;
|
||||||
|
return {
|
||||||
|
deployment_uuid: first?.deployment_uuid ?? first?.uuid ?? '',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getApplication(uuid: string): Promise<CoolifyApplication> {
|
export async function getApplication(uuid: string): Promise<CoolifyApplication> {
|
||||||
|
|||||||
Reference in New Issue
Block a user