인프런 커뮤니티 질문&답변
const에 관한 질문입니다.
작성
·
137
답변 1
1
John Ahn
지식공유자
안녕하세요 예림님 !
const body = {
//로그인 된 사람의 ID
writer: props.user.userData._id,
title: Title,
description: Description,
price: Price,
images: Images,
continents: Continent
}
Axios.post('/api/product', body)
.then(response => {
if (response.data.success) {
alert('상품 업로드에 성공 했습니다.')
props.history.push('/')
} else {
alert('상품 업로드에 실패 했습니다.')
}
})
}
여기 말씀하시는거죠 ~ ?
보시면 body를 정의한 이후에 body값을 바꿔주는 부분이 아래에 없기때문에 ~
const를 써주었습니다 ~
만약 바꿔주어야 하는 부분이있었다면 let으로 썻을거 같습니다 ^^





