Created
May 17, 2023 13:29
-
-
Save eyupfidan/efecd6071fc472a20e9df1933e16af2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showAlert(icon, title, text, url) { | |
Swal.fire({ | |
icon: icon, | |
title: title, | |
text: text, | |
showDenyButton: false, | |
showCancelButton: true, | |
confirmButtonColor: "green", | |
confirmButtonText: "Onaylıyorum", | |
cancelButtonText: "Vazgeç", | |
}).then((result) => { | |
if (result.isConfirmed) { | |
const data = { | |
articleID: articleID | |
}; | |
$.ajax({ | |
url: url, | |
type: "POST", | |
data: JSON.stringify(data), | |
contentType: "application/json", | |
dataType: "json", | |
success: function(data) { | |
const { title, html, icon } = data; | |
Swal.fire(title, html, icon); | |
} | |
}); | |
} | |
}); | |
} | |
function acceptButton() { | |
showAlert('question', 'Emin misiniz?', 'Onayladığınız takdirde yayın planına eklenecektir!', 'api/release_checklist/accept'); | |
} | |
function rejectButton() { | |
showAlert('danger', 'Emin misiniz?', 'Reddettiğiniz takdirde yayın planına eklenmeyecektir!', 'api/release_checklist/reject'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment