We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65a9006 commit ae31465Copy full SHA for ae31465
pages/index.js
@@ -44,14 +44,9 @@ IndexPage.getInitialProps = async () => {
44
let all = respPosts.status == 200 ? [...respPosts.data] : [];
45
let pinned = respStickyPosts.status == 200 ? [...respStickyPosts.data] : [];
46
47
- let tags = {};
48
const tagsOK = respTags.status == 200;
49
- // console.log(Object.values(respTags.data));
50
- if (tagsOK) {
51
- for (let tag of respTags.data) {
52
- tags[tag.id] = tag.slug;
53
- }
54
+ const tags = tagsOK ? Object.fromEntries(respTags.data.map((tag) => [tag.id, tag.slug])) : {};
+
55
return { all, pinned, tags };
56
};
57
0 commit comments