Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: new destinations

Andras Bacsai52b712d90bf3
diff --git a/apps/api/src/routes/api/v1/destinations/handlers.ts b/apps/api/src/routes/api/v1/destinations/handlers.ts
index 36e7f7aa4c..dfc7f16ef2 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 d4d2254398..504ea9acd3 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 });
- }
</script>
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl tracking-tight">{$t('index.destinations')}</div>
{#if $appSession.isAdmin}
- <button
- on:click={newDestination}
- class="add-icon bg-sky-600 hover:bg-sky-500">
+ <a href="/destinations/new" class="add-icon bg-sky-600 hover:bg-sky-500">
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -59,7 +53,7 @@
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
/></svg
>
- </button>
+ </a>
{/if}
</div>
<div class="flex-col justify-center">