Axios promise 반환 실수..

공부는 혼자하는 거·2021년 8월 21일
0

React Tip

목록 보기
13/24

yield call response 값 undefined 문제가 발생했다. 분명 백엔드서버단에서는 문제가 없는데 왜 이런 문제가 나오는지 곰곰히 생각한 결과.. 약 3시간 소요...

프론트서버에서 axios promise 반환 해주는것을 깜빡했다..

export const recommentSave = ({ commentId, content }) => {
  console.log('commentId', commentId, 'content', content);
  //아아아앙아아아앙아!!!!!!! return을 안 해줬구나!!!!!!!
  return client.post(`/comment/recomment/${commentId}`, JSON.stringify(content));
};
//유저 이미지 업로드
export const userImg = ({ userId, data }) => {
  // for (var pair of data.entries()) {
  //   console.log(pair[0] + ', ' + pair[1]);
  // }
  return client.put(`/user/${userId}/profileImageUrl`, data, config); //Json화 시켜줘서 오류가 떳구나!!! multipart인데!!! return문 또 빼먹었네..
};
profile
시간대비효율

0개의 댓글