Page MenuHomeDevCentral

D178.diff
No OneTemporary

D178.diff

diff --git a/app/Actions/ActionsReport.php b/app/Actions/ActionsReport.php
--- a/app/Actions/ActionsReport.php
+++ b/app/Actions/ActionsReport.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Actions;
-use Response;
-
class ActionsReport {
/**
* List of actions
@@ -89,23 +87,4 @@
public function __toString () {
return json_encode($this, JSON_PRETTY_PRINT);
}
-
- /**
- * Renders the report
- *
- * @return Illuminate\Http\Response
- */
- public function render () {
- return Response::json($this)
- ->setStatusCode($this->getResponseStatusCode());
- }
-
- /**
- * Determines the HTTP status code of the response
- *
- * @return int 200 if all is fine, 503 if an error is present
- */
- public function getResponseStatusCode () {
- return $this->containsError() ? 503 : 200;
- }
}
diff --git a/app/Http/Controllers/Gate/GateController.php b/app/Http/Controllers/Gate/GateController.php
--- a/app/Http/Controllers/Gate/GateController.php
+++ b/app/Http/Controllers/Gate/GateController.php
@@ -6,7 +6,9 @@
use Nasqueron\Notifications\Services;
use Nasqueron\Notifications\Http\Controllers\Controller;
+use App;
use Report;
+use Response;
use Storage;
/**
@@ -67,7 +69,10 @@
*/
protected function renderReport () {
if (Features::isEnabled('ActionsReport')) {
- return Report::render();
+ $report = App::make('report');
+ $statusCode = $report->containsError() ? 503 : 200;
+ return Response::json($report)
+ ->setStatusCode($statusCode);
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 06:07 (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2307629
Default Alt Text
D178.diff (1 KB)

Event Timeline