From 3c92878b30cf217aec12fcf0e0b4796c74d6f7a4 Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Sun, 24 Mar 2024 21:05:16 +0000 Subject: [PATCH] fix: always get latest release --- .../tauri/[version]/[target]/[arch]/route.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts b/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts index 79ac7357..dfd49d9a 100644 --- a/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts +++ b/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts @@ -19,21 +19,10 @@ export async function GET( } ) { try { - let release; - if (params.version === "latest") { - const { data } = await octokit.repos.getLatestRelease({ - owner: "capsoftware", - repo: "cap", - }); - release = data; - } else { - const { data } = await octokit.repos.getReleaseByTag({ - owner: "capsoftware", - repo: "cap", - tag: `cap-v${params.version}`, - }); - release = data; - } + const { data: release } = await octokit.repos.getLatestRelease({ + owner: "capsoftware", + repo: "cap", + }); const version = release.tag_name.replace("cap-v", ""); const notes = release.body;