mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-29 05:12:06 +00:00
feat: Autodeploy pause
This commit is contained in:
@@ -8,10 +8,17 @@ export const post: RequestHandler = async (event) => {
|
||||
if (status === 401) return { status, body };
|
||||
|
||||
const { id } = event.params;
|
||||
const { debug, previews, dualCerts } = await event.request.json();
|
||||
const { debug, previews, dualCerts, autodeploy, branch, projectId } = await event.request.json();
|
||||
|
||||
try {
|
||||
await db.setApplicationSettings({ id, debug, previews, dualCerts });
|
||||
const isDouble = await db.checkDoubleBranch(branch, projectId);
|
||||
if (isDouble && autodeploy) {
|
||||
throw {
|
||||
message:
|
||||
'Cannot activate automatic deployments until only one application is defined for this repository / branch.'
|
||||
};
|
||||
}
|
||||
await db.setApplicationSettings({ id, debug, previews, dualCerts, autodeploy });
|
||||
return { status: 201 };
|
||||
} catch (error) {
|
||||
return ErrorHandler(error);
|
||||
|
||||
Reference in New Issue
Block a user