()
| 16 | } |
| 17 | |
| 18 | const fetchPosts = async () => { |
| 19 | console.info('Fetching posts...') |
| 20 | await new Promise((r) => setTimeout(r, 500)) |
| 21 | return axios |
| 22 | .get<Array<PostType>>(`${queryURL}/posts`) |
| 23 | .then((r) => r.data.slice(0, 10)) |
| 24 | } |
| 25 | |
| 26 | const fetchPost = async (postId: string) => { |
| 27 | console.info(`Fetching post with id ${postId}...`) |