Skip to content

Commit e657af4

Browse files
committed
52
1 parent 8503107 commit e657af4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/BlogList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const BlogList = ({ isAdmin }) => {
1111
const [posts, setPosts] = useState([]);
1212
const [loading, setLoading] = useState(true);
1313

14-
const getPosts = () => {
15-
axios.get('http://localhost:3001/posts').then((res) => {
14+
const getPosts = (page = 1) => {
15+
axios.get(`http://localhost:3001/posts?_page=${page}&_limit=5&_sort=id&_order=desc`).then((res) => {
1616
setPosts(res.data);
1717
setLoading(false);
1818
})

0 commit comments

Comments
 (0)