mirror of
https://github.com/System-End/site.git
synced 2026-04-19 18:35:12 +00:00
Bin won't error (#1677)
This commit is contained in:
parent
7ad546e9dc
commit
3b97417442
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue