Skip to content

Commit

Permalink
fix no success msg
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 12, 2022
1 parent 8ff571e commit 5f419c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/JsCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ public function set($fx = null, $args = null)
*/
public function terminateAjax($ajaxec, $msg = null, bool $success = true): void
{
$data = ['success' => $success];
if (!$success) {
$data['message'] = $msg;
}
$data['atkjs'] = $ajaxec;

if ($this->canTerminate()) {
$this->getApp()->terminateJson(['success' => $success, ...($msg !== null ? ['message' => $msg] : []), 'atkjs' => $ajaxec]);
$this->getApp()->terminateJson($data);
}
}

Expand Down

0 comments on commit 5f419c4

Please sign in to comment.