mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-24 05:02:12 +00:00
fixes
This commit is contained in:
@@ -843,18 +843,11 @@ export async function saveApplicationSource(request: FastifyRequest<SaveApplicat
|
||||
const { id } = request.params
|
||||
const { gitSourceId, forPublic, type, simpleDockerfile } = request.body
|
||||
if (forPublic) {
|
||||
if (gitSourceId) {
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: gitSourceId } } }
|
||||
});
|
||||
} else {
|
||||
const publicGit = await prisma.gitSource.findFirst({ where: { type, forPublic } });
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: publicGit.id } } }
|
||||
});
|
||||
}
|
||||
const publicGit = await prisma.gitSource.findFirst({ where: { type, forPublic } });
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: publicGit.id } } }
|
||||
});
|
||||
}
|
||||
if (simpleDockerfile) {
|
||||
await prisma.application.update({
|
||||
@@ -862,6 +855,12 @@ export async function saveApplicationSource(request: FastifyRequest<SaveApplicat
|
||||
data: { simpleDockerfile, settings: { update: { autodeploy: false } } }
|
||||
});
|
||||
}
|
||||
if (gitSourceId) {
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: gitSourceId } } }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return reply.code(201).send()
|
||||
|
||||
Reference in New Issue
Block a user