about summary refs log tree commit diff
path: root/components/Posts/PostList/index.js
blob: dad805dcd8e7ca295a60a662d9725e6ba9b800b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
import axios from 'axios'

import { apiUrl, parsePosts } from '~/api'
import PostList from './PostList'

export const getPosts = async () => {
  let posts = await axios.get(`${apiUrl}/posts.json`)
  return parsePosts(posts.data)
}

export default PostList