Update frontend/src/app/api/categories/route.ts

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>
This commit is contained in:
Bram Suurd 2024-11-06 21:46:21 +01:00 committed by GitHub
parent 1c4321c466
commit 3b59f5b0ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,11 @@ const fetchAllMetaDataFiles = async () => {
`https://api.github.com/repos/community-scripts/${basePath}/contents/json`, `https://api.github.com/repos/community-scripts/${basePath}/contents/json`,
); );
const files = await response.json(); const files = await response.json();
const scripts: Script[] = []; const scripts = files.map(async (file) => {
const response = await fetch(file.download_url);
const script = await response.json();
return script
})
for (const file of files) { for (const file of files) {
const response = await fetch(file.download_url); const response = await fetch(file.download_url);
const script = await response.json(); const script = await response.json();