mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-03-14 12:29:44 +01:00
Incidents will now be removed via the command
This commit is contained in:
parent
b80b53191b
commit
7be3aa2552
@ -11,16 +11,20 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use Exception;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
class IncidentController extends AbstractApiController
|
||||
{
|
||||
use DispatchesJobs;
|
||||
|
||||
/**
|
||||
* Get all incidents.
|
||||
*
|
||||
@ -122,7 +126,7 @@ class IncidentController extends AbstractApiController
|
||||
*/
|
||||
public function deleteIncident(Incident $incident)
|
||||
{
|
||||
$incident->delete();
|
||||
$this->dispatch(new RemoveIncidentCommand($incident));
|
||||
|
||||
return $this->noContent();
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use AltThree\Validator\ValidationException;
|
||||
use CachetHQ\Cachet\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
@ -19,6 +20,7 @@ use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
@ -27,6 +29,8 @@ use Jenssegers\Date\Date;
|
||||
|
||||
class IncidentController extends Controller
|
||||
{
|
||||
use DispatchesJobs;
|
||||
|
||||
/**
|
||||
* Stores the sub-sidebar tree list.
|
||||
*
|
||||
@ -208,7 +212,7 @@ class IncidentController extends Controller
|
||||
*/
|
||||
public function deleteIncidentAction(Incident $incident)
|
||||
{
|
||||
$incident->delete();
|
||||
$this->dispatch(new RemoveIncidentCommand($incident));
|
||||
|
||||
return Redirect::route('dashboard.incidents.index');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user