Changed alert messages for successfull or failed reports

This commit is contained in:
oslomp
2018-12-15 14:14:24 +01:00
parent aff8ddf878
commit 1da2f4cc05

View File

@ -49,13 +49,13 @@ $(function () {
var songId = $(this).data('report-song-id'); var songId = $(this).data('report-song-id');
var message = prompt("What is wrong with the song?"); var message = prompt("What is wrong with the song?");
if (message == "") { if (message == "") {
alert("Please enter a message."); createAlert('danger', 'Please enter a message.');
return false return false
} }
$.post('/api/report', {id: songId, msg: message, csrfmiddlewaretoken: csrf_token}, function (result) { $.post('/api/report', {id: songId, msg: message, csrfmiddlewaretoken: csrf_token}, function (result) {
console.log(result); console.log(result);
if (result.success) { if (result.success) {
alert("Thanks for the report!"); createAlert('success', 'Thanks for your song report!');
} }
}); });
return false; return false;