Skip to content

Commit aad696b

Browse files
committed
53
1 parent e657af4 commit aad696b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/BlogList.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ const BlogList = ({ isAdmin }) => {
1212
const [loading, setLoading] = useState(true);
1313

1414
const getPosts = (page = 1) => {
15-
axios.get(`http://localhost:3001/posts?_page=${page}&_limit=5&_sort=id&_order=desc`).then((res) => {
15+
axios.get(`http://localhost:3001/posts`, {
16+
params: {
17+
_page: page,
18+
_limit: 5,
19+
_sort: 'id',
20+
_order: 'desc',
21+
}
22+
}).then((res) => {
1623
setPosts(res.data);
1724
setLoading(false);
1825
})

0 commit comments

Comments
 (0)