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:47:07 +01:00 committed by GitHub
parent 16657ec891
commit e8ff2858d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,7 @@ const fetchScripts = async (): Script[] => {
export async function GET() { export async function GET() {
try { try {
const categories: Category[] = await fetchCategories(); const categories = await fetchCategories();
const scripts = await fetchScripts(); const scripts = await fetchScripts();
for (const category of categories) { for (const category of categories) {
category.scripts = scripts.filter((script) => script.categories.includes(category.id)); category.scripts = scripts.filter((script) => script.categories.includes(category.id));