Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit 3fb32e3

Browse files
committed
fix the parsing error occured in postActions file
1 parent 05314a8 commit 3fb32e3

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/actions/postActions.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { FETCH_POSTS, NEW_POST } from "./types";
22

3-
export const fetchPosts = () => dispatch => {
4-
fetch("https://jsonplaceholder.typicode.com/posts")
5-
.then((res) => res.json())
6-
.then((posts) =>
7-
dispatch({
8-
type: FETCH_POSTS,
9-
payload: posts,
10-
})
11-
);
12-
};
13-
}
3+
export const fetchPosts = () => (dispatch) => {
4+
fetch("https://jsonplaceholder.typicode.com/posts")
5+
.then((res) => res.json())
6+
.then((posts) =>
7+
dispatch({
8+
type: FETCH_POSTS,
9+
payload: posts,
10+
})
11+
);
12+
};

0 commit comments

Comments
 (0)