marpple/FxDOM

fetch 에서 reject 할 때 데이터 형태 수정

Closed this issue · 1 comments

요약

  • 현재 _fetchWithBody 함수에서 _resJSON 함수로 응답 처리중
  • _resJSON 함수에서 res.ok 에 따라 resolve 또는 reject 처리
  • resolve 에서는 res 객체를 JSON 형태로 변환
  • reject 에서는 res 객체 그대로 처리

요구사항

  • reject 처리에서도 res.json() 으로 JSON 형태 데이터로 변환해서 처리
  • $post, $put, $del 과 같은 _fetchWithBody 사용하는 함수는 요청과 응답 모두 JSON 형태 데이터를 사용하도록 강제