Add error handling if there is a problem getting the task list
This commit is contained in:
parent
445dae586e
commit
e3b7d9351f
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user