Inflearn Community Q&A
saga get 질문있습니다 !
Written on
·
151
0
function loadFollowersAPI(data) {
return axios.get('/user/followers');
}
function* loadFollowers(action) {
try {
console.log("load 팔로워스 가져오려고 하는 action")
console.log(action);
const result = yield call(loadFollowersAPI, action.data);
yield put({
type: LOAD_FOLLOWERS_SUCCESS,
data: result.data,
});
} catch (err) {
console.error(err);
yield put({
type: LOAD_FOLLOWERS_FAILURE,
error: err.response.data,
});
}
}
위 코드에서 get은 data를 어차피 보낼 수 없다고 말씀하신걸로 알고 있습니다
그러면 애초에 call()메서드에서 2번째 data로 아무값도 안 넣어줘도
오류가 안날까요 ? 궁금해서 여쭤봤습니다!
reactnodejsreduxexpressNext.js




