Bin won't error (#1677)

This commit is contained in:
Clay Nicholson 2025-10-16 12:05:07 -04:00 committed by GitHub
parent 7ad546e9dc
commit 3b97417442
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,14 +14,14 @@ export async function getStaticProps() {
const res = await fetch(`${host}/api/bin/gallery/posts/`);
const posts = await res.json();
const filteredPosts = await posts.filter(post => post.status === 'Accepted' && post.parts && !post.hide);
const filteredPosts = Array.isArray(posts) ? posts.filter(post => post.status === 'Accepted' && post.parts && !post.hide) : [];
//Tags
const resTag = await fetch(`${host}/api/bin/gallery/tags/`);
const tags = await resTag.json();
const filteredTags = tags.filter(tag => !tag.hide);
const filteredTags = Array.isArray(tags) ? tags.filter(tag => !tag.hide) : [];
return {
props: { posts: filteredPosts,
tags: filteredTags