fix: empty remote destinations could be removed

This commit is contained in:
Andras Bacsai
2022-08-08 12:17:01 +00:00
parent b999e7dab1
commit 99bc374664
2 changed files with 19 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ export async function getDestination(request: FastifyRequest<OnlyId>) {
const teamId = request.user?.teamId;
const destination = await prisma.destinationDocker.findFirst({
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
include: { sshKey: true }
include: { sshKey: true, application: true, service: true, database: true }
});
if (!destination && id !== 'new') {
throw { status: 404, message: `Destination not found.` };