JS handle_ajax_return() helper: fix handling Tpl :: display_ajax_error() response type
This commit is contained in:
parent
6f9f6fe3cf
commit
12217d642e
1 changed files with 2 additions and 1 deletions
|
@ -176,6 +176,7 @@ function handle_ajax_return(
|
|||
"done" in data && "fail" in data && "always" in data
|
||||
? data.responseJSON ?? {}
|
||||
: data;
|
||||
if (data.error) alertify.notify(data.error, "error");
|
||||
if (data.errors)
|
||||
$(data.errors).each(function (idx, error) {
|
||||
alertify.notify(error, "error");
|
||||
|
@ -191,7 +192,7 @@ function handle_ajax_return(
|
|||
alertify.notify(success_message, "success", 5);
|
||||
return true;
|
||||
}
|
||||
if (!(data.errors && data.errors.length))
|
||||
if (!(data.errors && data.errors.length) && !data.error)
|
||||
alertify.notify(
|
||||
default_error ??
|
||||
_(
|
||||
|
|
Loading…
Reference in a new issue