We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8503107 commit e657af4Copy full SHA for e657af4
src/components/BlogList.js
@@ -11,8 +11,8 @@ const BlogList = ({ isAdmin }) => {
11
const [posts, setPosts] = useState([]);
12
const [loading, setLoading] = useState(true);
13
14
- const getPosts = () => {
15
- axios.get('http://localhost:3001/posts').then((res) => {
+ const getPosts = (page = 1) => {
+ axios.get(`http://localhost:3001/posts?_page=${page}&_limit=5&_sort=id&_order=desc`).then((res) => {
16
setPosts(res.data);
17
setLoading(false);
18
})
0 commit comments