Skip to content

Commit 0f0f5b4

Browse files
fixup! remove blog-data endpoint and use public json file instead
avoid temporary blogData variable
1 parent 2fb80a8 commit 0f0f5b4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

apps/site/next-data/providers/blogData.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import { cache } from 'react';
22

33
import { BLOG_POSTS_PER_PAGE } from '@/next.constants.mjs';
4-
import { blogData as rawBlogData } from '@/next.json.mjs';
4+
import { blogData } from '@/next.json.mjs';
55
import type { BlogCategory, BlogPostsRSC } from '@/types';
66

7-
const blogData = {
8-
...rawBlogData,
9-
posts: rawBlogData.posts.map(post => ({
7+
const { categories, posts } = {
8+
...blogData,
9+
posts: blogData.posts.map(post => ({
1010
...post,
1111
date: new Date(post.date),
1212
})),
1313
};
1414

15-
const { categories, posts } = blogData;
16-
1715
export const provideBlogCategories = cache(() => categories);
1816

1917
export const provideBlogPosts = cache(

0 commit comments

Comments
 (0)