Add error handling if there is a problem getting the task list

This commit is contained in:
Junior 2026-11-22 14:24:26 -05:00
parent 445dae586e
commit e3b7d9351f

View File

@ -210,6 +210,10 @@ function getTasks() {
url: 'ajax/task-list.php', url: 'ajax/task-list.php',
dataType: 'json', dataType: 'json',
success: function(data, stat, jqo) { success: function(data, stat, jqo) {
if ( data.error ) {
toastr.error(data.message, "Error retrieving task list");
return;
}
$("#form_showall").prop('checked', data.showalltasks); $("#form_showall").prop('checked', data.showalltasks);
let show = ""; let show = "";
data.tasks.forEach(function(task, index) { data.tasks.forEach(function(task, index) {