Make sure a task object is returned when setting completion state
This commit is contained in:
parent
34af4254a2
commit
c09ab3c48e
|
|
@ -118,6 +118,10 @@ function setTaskCompleteState(complete = TASKCOMPLETE) {
|
||||||
toastr.error(data.message, "Submission Error");
|
toastr.error(data.message, "Submission Error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ( !Object.hasOwn(data, "task") ) {
|
||||||
|
toastr.error("API Error", "No task returned");
|
||||||
|
return;
|
||||||
|
}
|
||||||
toastr.success(data.message, (data.task.completed) ? "Task Complete" : "Task Incomplete");
|
toastr.success(data.message, (data.task.completed) ? "Task Complete" : "Task Incomplete");
|
||||||
getTasks();
|
getTasks();
|
||||||
updateImage();
|
updateImage();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user