diff --git a/src/app/characters/[slug]/page.tsx b/src/app/characters/[slug]/page.tsx index c0aa0f1..eeb70e7 100644 --- a/src/app/characters/[slug]/page.tsx +++ b/src/app/characters/[slug]/page.tsx @@ -37,21 +37,20 @@ export default async function Home({ } = JSON.parse(charblogs.data.body.replace(/[“”]/g, "\"")); const images = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts/${character.picture}`).then(x=>x.json()); - // // REQSPAMMER - // let allPosts = []; - // let currentPage = 1; + let allPosts = []; + let currentPage = 1; - // const initReq = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts`).then(x=>x.json()); - // const totalPosts:number = initReq.data.total_posts; + const initReq = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts`).then(x=>x.json()); + const totalPosts:number = initReq.data.total_posts; - // while (currentPage * 10 < totalPosts) { - // const newPostList = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts?page=${currentPage}`).then(x=>x.json()); - // allPosts.push(...newPostList.data.posts); + while (currentPage * 10 < totalPosts) { + const newPostList = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts?page=${currentPage}`).then(x=>x.json()); + allPosts.push(...newPostList.data.posts); - // currentPage++; - // } + currentPage++; + } - // const myPosts = allPosts.filter(post => post.tags?.includes(character.id)); + const myPosts = allPosts.filter(post => post.tags?.includes(character.id)); return ( @@ -69,8 +68,7 @@ export default async function Home({

Gallery

-

Feature coming soon...

- {/*
+
{myPosts.map(async (img:{ slug: string, title: string, @@ -88,7 +86,7 @@ export default async function Home({ ); })} -
*/} +
) } \ No newline at end of file