js/reply.js
페이지 정보
본문
//목록
async function getList({bno, page, size, goLast}){
const result = await axios.get(`/replies/list/${bno}`, {params: {page, size}})
if(goLast){ //마지막 페이지 호출
const total = result.data.total
const lastPage = parseInt(Math.ceil(total/size))
return getList({bno:bno, page:lastPage, size:size})
}
return result.data;
}
//등록
async function addReply(replyObj) {
const response = await axios.post(`/replies/`,replyObj)
return response.data
}
//조회
async function getReply(rno) {
const response = await axios.get(`/replies/${rno}`)
return response.data
}
//수정
async function modifyReply(replyObj) {
const response = await axios.put(`/replies/${replyObj.rno}`, replyObj)
return response.data
}
//삭제
async function removeReply(rno) {
const response = await axios.delete(`/replies/${rno}`)
return response.data
}
- 이전글● 댓글 조회,수정,삭제 24.06.25
- 다음글board/read.html 24.06.25
댓글목록
등록된 댓글이 없습니다.