RELEASE THE REQSPAMMER
This commit is contained in:
parent
745bba3c08
commit
bd8c548978
1 changed files with 12 additions and 14 deletions
|
@ -37,21 +37,20 @@ export default async function Home({
|
||||||
} = JSON.parse(charblogs.data.body.replace(/[“”]/g, "\""));
|
} = 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());
|
const images = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts/${character.picture}`).then(x=>x.json());
|
||||||
|
|
||||||
// // REQSPAMMER
|
let allPosts = [];
|
||||||
// let allPosts = [];
|
let currentPage = 1;
|
||||||
// let currentPage = 1;
|
|
||||||
|
|
||||||
// const initReq = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts`).then(x=>x.json());
|
const initReq = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts`).then(x=>x.json());
|
||||||
// const totalPosts:number = initReq.data.total_posts;
|
const totalPosts:number = initReq.data.total_posts;
|
||||||
|
|
||||||
// while (currentPage * 10 < totalPosts) {
|
while (currentPage * 10 < totalPosts) {
|
||||||
// const newPostList = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts?page=${currentPage}`).then(x=>x.json());
|
const newPostList = await fetch(`https://img.abtmtr.link/api/collections/mtr/posts?page=${currentPage}`).then(x=>x.json());
|
||||||
// allPosts.push(...newPostList.data.posts);
|
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 (
|
return (
|
||||||
<MainLayout currentPage="/characters/" title="Characters" backButton>
|
<MainLayout currentPage="/characters/" title="Characters" backButton>
|
||||||
|
@ -69,8 +68,7 @@ export default async function Home({
|
||||||
</ConditionalNull>
|
</ConditionalNull>
|
||||||
</div>
|
</div>
|
||||||
<h2>Gallery</h2>
|
<h2>Gallery</h2>
|
||||||
<p><i>Feature coming soon...</i></p>
|
<div className={styles.CharacterContainerGrid}>
|
||||||
{/* <div className={styles.CharacterContainerGrid}>
|
|
||||||
{myPosts.map(async (img:{
|
{myPosts.map(async (img:{
|
||||||
slug: string,
|
slug: string,
|
||||||
title: string,
|
title: string,
|
||||||
|
@ -88,7 +86,7 @@ export default async function Home({
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div> */}
|
</div>
|
||||||
</MainLayout>
|
</MainLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
Reference in a new issue