Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3750697
D178.id421.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D178.id421.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D178: Refactor ActionsReport render operation
Attached
Detach File
Event Timeline
Log In to Comment