We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 092e728 + 7d98608 commit 8868a72Copy full SHA for 8868a72
1 file changed
toolkit/front/actions/post.js
@@ -7,8 +7,19 @@ axios.defaults.baseURL = backendUrl;
7
axios.defaults.withCredentials = true; // front, backend 간 쿠키공유
8
9
export const loadPosts = createAsyncThunk('post/loadPosts', async (data) => {
10
- const response = await axios.get(`/posts?last=${data?.lastId || 0}`);
+ const response = await axios.get(`/posts?lastId=${data?.lastId || 0}`);
11
return response.data;
12
+},
13
+{
14
+ condition: (data, { getState }) => {
15
+ const { post } = getState();
16
+
17
+ if (post.loadPostsLoading) {
18
+ // console.warn('중복 요청 취소');
19
+ return false;
20
+ }
21
+ return true;
22
+ },
23
});
24
25
export const addPost = createAsyncThunk('post/addPost', async (data, thunkAPI) => {
0 commit comments