Skip to content

Commit d98eecf

Browse files
authored
Merge pull request #340 from theMattCode/bugfix/aktuelles-page
Fix auth error on page '/aktuelles'
2 parents 4e9fa1a + 061c3b4 commit d98eecf

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

app/(web)/aktuelles/page.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { getTitle, PageProps } from "#/lib/page";
2-
import { PaginatedArticles } from "#/content/article";
3-
import { getURL } from "#/lib/url";
2+
import { getArticles, PaginatedArticles } from "#/content/article";
43
import { Metadata } from "next";
54
import { aktuelles } from "#/content/sitemap";
65
import { Section } from "#/components/web/section/Section";
@@ -17,10 +16,7 @@ const PAGE_SIZE = 20;
1716
export default async function Aktuelles(props: PageProps) {
1817
const searchParams = await props.searchParams;
1918
const page = searchParams.page ? Number.parseInt(searchParams.page.toString()) : 1;
20-
const articlesResponse = await fetch(`${getURL()}/api/articles?page=${page}&pageSize=${PAGE_SIZE}`, {
21-
next: { revalidate: false },
22-
});
23-
const paginatedArticles: PaginatedArticles = await articlesResponse.json();
19+
const paginatedArticles: PaginatedArticles = getArticles(page, PAGE_SIZE, "public/content/article");
2420
return (
2521
<PageContent>
2622
<Section title={aktuelles.name}>

components/web/events/EventGrid.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export function EventGrid() {
1919
throw new Error(`HTTP error! status: ${response.status}`);
2020
}
2121
const data: Event[] = await response.json();
22-
console.log(data); // Debugging: Log the fetched data to see its structure
2322
setEvents(data);
2423
} catch (e) {
2524
if (e instanceof Error) {

0 commit comments

Comments
 (0)