Add System::jsonExit()
This commit is contained in:
parent
c2b8c65104
commit
d1b7bfda4b
|
@ -46,14 +46,11 @@ class Notification extends BaseModule
|
||||||
try {
|
try {
|
||||||
$success = DI::notify()->setAllSeen();
|
$success = DI::notify()->setAllSeen();
|
||||||
}catch (\Exception $e) {
|
}catch (\Exception $e) {
|
||||||
|
DI::logger()->warning('set all seen failed.', ['exception' => $e]);
|
||||||
$success = false;
|
$success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-type: application/json; charset=utf-8');
|
System::jsonExit(['result' => (($success) ? 'success' : 'fail')]);
|
||||||
echo json_encode([
|
|
||||||
'result' => ($success) ? 'success' : 'fail',
|
|
||||||
]);
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +80,6 @@ class Notification extends BaseModule
|
||||||
DI::baseUrl()->redirect();
|
DI::baseUrl()->redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: Replace with parameter from router
|
|
||||||
DI::baseUrl()->redirect('notifications/system');
|
DI::baseUrl()->redirect('notifications/system');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user