타임라인 만들기 Project

deleteOne - 삭제기능

코린이 연대기 2020. 12. 1. 12:48

 

// 메모를 삭제합니다.
        function deleteOne(id) {
            // 1. DELETE /api/memos/{id} 에 요청해서 메모를 삭제합니다.
            function deleteOne(id) {
                $.ajax({
                    type: "DELETE",
                    url: `/api/memos/${id}`,
                    success: function (response) {
                        alert('메시지 삭제에 성공하였습니다.');
                        window.location.reload();
                    }
                })
            }
        }