반응형
return fetch(`${API_BASE_URL}/admin/terms/published-terms?type=${data}`, {
method: 'POST',
headers: getHeaders(),
})
//.then(res => res.json())
.then(body => {
console.log('body', body);
console.log('body json', body.json());//이게 없으면 크롬인스텍서 preview, response에서 안보임
console.log('body body', body.body);
if (body.status===200)
alert('Successfully Published !');
else
alert('Some Error Occured !');
})
.catch(() => {});
반응형
'js' 카테고리의 다른 글
axios(설치필요,더많은기능지원) vs fetch(브라우저 기본내장) (0) | 2022.07.07 |
---|---|
JS 모듈시스템: CommonJS, AMD(RequireJS), ES6 (0) | 2022.06.23 |
CORS(Cross-Origin Resource Sharing) (0) | 2022.06.10 |
react-scripts build (0) | 2020.12.17 |
page redirect 방법들 (0) | 2020.04.12 |