i have delete button like this, that i found in youtube. but whenever i click the button im getting error Uncaught TypeError: $setup.destroy is not a function
import axios from 'axios';
// Inside destroy function
axios.delete(`/path/to/delete/post/${id}`)
.then(response => {
console.log("Deleted successfully!");
// maybe remove post from the list or navigate elsewhere
})
.catch(error => {
console.error("Error deleting the post:", error);
});