From 2169131863e2a677c7b327bd51dd59454bb59090 Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Wed, 6 Nov 2024 23:25:11 +0100 Subject: [PATCH] Fix fetch URLs by removing unnecessary slashes and ensure proper return type in fetchScripts map function --- frontend/src/app/api/categories/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/api/categories/route.ts b/frontend/src/app/api/categories/route.ts index a38eaf84..8001ded4 100644 --- a/frontend/src/app/api/categories/route.ts +++ b/frontend/src/app/api/categories/route.ts @@ -6,7 +6,7 @@ export const dynamic = "force-static"; const fetchCategories = async (): Promise => { const response = await fetch( - `https://raw.githubusercontent.com/community-scripts/${basePath}/refs/heads/main/json/metadata.json`, + `https://raw.githubusercontent.com/community-scripts${basePath}/refs/heads/main/json/metadata.json`, ); const data = await response.json(); return data.categories; @@ -14,11 +14,11 @@ const fetchCategories = async (): Promise => { const fetchScripts = async (): Promise => { const response = await fetch( - `https://api.github.com/repos/community-scripts/${basePath}/contents/json`, + `https://api.github.com/repos/community-scripts${basePath}/contents/json`, ); const files: { download_url: string }[] = await response.json(); const scripts = await Promise.all( - files.map(async (file): Promise