()
| 11 | const queryURL = 'https://jsonplaceholder.typicode.com' |
| 12 | |
| 13 | export const fetchPosts = async () => { |
| 14 | console.info('Fetching posts...') |
| 15 | return axios |
| 16 | .get<Array<PostType>>(`${queryURL}/posts`) |
| 17 | .then((r) => r.data.slice(0, 10)) |
| 18 | } |
| 19 | |
| 20 | export const fetchPost = async (postId: string) => { |
| 21 | console.info(`Fetching post with id ${postId}...`) |