<commit_before>const deleteReview = (deleteButton) => {
  const reviewId = deleteButton.target.getAttribute('data-review-id')
  fetch(`/deletereview/${reviewId}`, {method: 'delete', credentials: 'include'})
    .then(location.reload())
    .catch((error) => {
      console.error(error)
    })
}

document.querySelectorAll('.delete').forEach((deleteButton) => {
  deleteButton.addEventListener('click', deleteReview)
})<commit_msg>Clicking delete button shows confirm prompt before deleting<commit_after>const deleteReview = (deleteButton) => {
  const confirmDelete = confirm('Are you sure you want to delete this review?')
  if (confirmDelete) {
    const reviewId = deleteButton.target.getAttribute('data-review-id')
    fetch(`/deletereview/${reviewId}`, {method: 'delete', credentials: 'include'})
      .then(location.reload())
      .catch((error) => {
        console.error(error)
      })
  }
}

document.querySelectorAll('.delete').forEach((deleteButton) => {
  deleteButton.addEventListener('click', deleteReview)
})
{'fraction_non_alphanumeric': 0.1596884128529698, 'fraction_numerical': 0.0, 'mean_word_length': 4.908045977011494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4963248', 'n_tokens_mistral': 290, 'n_tokens_neox': 289, 'n_words': 54}