react와 express 서버 연동 익히기 8편 -DB 데이터 수정하기-
1. App.js 수정 App.js에 데이터를 수정하는 함수 modifyData를 작성 async function modifyData(el) { const modify = prompt(el.name + '을 어떤 이름으로 변경할까요?') if (modify !== null) { const body = { name : modify, id : el.id } const res = await axios('/modify/data', { method : 'POST', data : {'modify' : body}, headers : new Headers() }) if (res.data) { alert('데이터를 수정했습니다.') return window.location.reload() } } } 그리고 return에..