Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 8eda8df

Browse files
committed
Used Youngs fetch service to get blog data on client side
1 parent 2157895 commit 8eda8df

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/pages/app-blog-index/app-blog-index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, State, h, Build } from '@stencil/core';
22
import { BLOG_DATA } from '../app-blog-post/prerender-blog-data';
3+
import * as Fetch from '../../shared/fetch-handler';
34

45
@Component({
56
tag: 'app-blog-index',
@@ -12,14 +13,9 @@ export class AppBlogIndex {
1213
if (!Build.isBrowser) {
1314
this.blogData = BLOG_DATA.data;
1415
} else {
15-
// this.butter.post
16-
// .list({ page: 1, page_size: 100000, exclude_body: true })
17-
// .then(resp => {
18-
// this.blogData = resp.data.data;
19-
// })
20-
// .catch(resp => {
21-
// console.error('Could not load blog data ', resp);
22-
// });
16+
Fetch.fetchBlogPosts().then(resp => {
17+
this.blogData = resp.data;
18+
});
2319
}
2420
}
2521

0 commit comments

Comments
 (0)