Page MenuHomeDevCentral

D178.id421.diff
No OneTemporary

D178.id421.diff

diff --git a/app/Actions/ActionsReport.php b/app/Actions/ActionsReport.php
--- a/app/Actions/ActionsReport.php
+++ b/app/Actions/ActionsReport.php
@@ -2,11 +2,6 @@
namespace Nasqueron\Notifications\Actions;
-use Nasqueron\Notifications\Events\ReportEvent;
-
-use Event;
-use Response;
-
class ActionsReport {
/**
* List of actions
@@ -92,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
Mon, Nov 18, 02:54 (15 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2250143
Default Alt Text
D178.id421.diff (1 KB)

Event Timeline