0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-05 08:40:11 +00:00

Addressed test failures from users API changes

This commit is contained in:
Dan Brown 2022-02-04 01:02:13 +00:00
parent 46e6e239dc
commit c8be6ee8a6
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
5 changed files with 9 additions and 5 deletions
app/Exceptions

View file

@ -39,6 +39,11 @@ class NotifyException extends Exception implements Responsable
{
$message = $this->getMessage();
// Front-end JSON handling. API-side handling managed via handler.
if ($request->wantsJson()) {
return response()->json(['error' => $message], 403);
}
if (!empty($message)) {
session()->flash('error', $message);
}