From 52b712d90bf345b162af441b9ffa7484977e5968 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 6 Jul 2022 16:42:31 +0200 Subject: [PATCH] fix: new destinations --- apps/api/src/routes/api/v1/destinations/handlers.ts | 7 ++----- apps/ui/src/routes/destinations/index.svelte | 10 ++-------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/api/src/routes/api/v1/destinations/handlers.ts b/apps/api/src/routes/api/v1/destinations/handlers.ts index 36e7f7aa4..dfc7f16ef 100644 --- a/apps/api/src/routes/api/v1/destinations/handlers.ts +++ b/apps/api/src/routes/api/v1/destinations/handlers.ts @@ -43,7 +43,7 @@ export async function getDestination(request: FastifyRequest) { const destination = await prisma.destinationDocker.findFirst({ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } } }); - if (!destination) { + if (!destination && id !== 'new') { throw { status: 404, message: `Destination not found.` }; } const settings = await listSettings(); @@ -62,10 +62,7 @@ export async function getDestination(request: FastifyRequest) { // // await saveSshKey(destination); // payload.state = await checkContainer(engine, 'coolify-haproxy'); } else { - let containerName = 'coolify-proxy'; - if (!settings.isTraefikUsed) { - containerName = 'coolify-haproxy'; - } + const containerName = 'coolify-proxy'; payload.state = destination?.engine && (await checkContainer(destination.engine, containerName)); } diff --git a/apps/ui/src/routes/destinations/index.svelte b/apps/ui/src/routes/destinations/index.svelte index d4d225439..504ea9acd 100644 --- a/apps/ui/src/routes/destinations/index.svelte +++ b/apps/ui/src/routes/destinations/index.svelte @@ -34,18 +34,12 @@ return destination; } }); - async function newDestination() { - const { id } = await post('/destinations/new', {}); - return await goto(`/destinations/${id}`, { replaceState: true }); - }
{$t('index.destinations')}
{#if $appSession.isAdmin} - + {/if}