Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Sep 1, 2021
1 parent 2bcd21c commit 980fd9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Listeners/Document/CreateDocumentTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ public function handle(Event $event)

protected function getResponse($path, $document, $message)
{
$url = route($path, $document->id);

if (request()->expectsJson()) {
return response()->json([
'success' => false,
'errors' => true,
'message' => $message,
'redirect' => route($path, $document->id)
'redirect' => $url,
]);
}

return redirect()->route($path, $document->id);
return redirect($url);
}
}

0 comments on commit 980fd9a

Please sign in to comment.