A lot of things.
This commit is contained in:
@@ -4,7 +4,9 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Exceptions\SubmissionException;
|
||||
use App\Helpers\FormHelpers;
|
||||
use App\Http\Requests\StoreDraftRequest;
|
||||
use App\Http\Requests\StoreEntryRequest;
|
||||
use App\Jobs\DeleteXenForoCommentsThread;
|
||||
use App\Models\Author;
|
||||
use App\Models\Entry;
|
||||
use App\Models\EntryFile;
|
||||
@@ -17,6 +19,7 @@ use App\Models\Modification;
|
||||
use App\Models\Platform;
|
||||
use App\Models\Status;
|
||||
use App\Services\SubmissionsService;
|
||||
use App\Services\XenforoApiService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -82,7 +85,22 @@ class SubmissionController extends Controller
|
||||
return view('submissions.edit', $data);
|
||||
}
|
||||
|
||||
public function store(StoreEntryRequest $request, string $section){
|
||||
public function destroy(Request $request, string $section, Entry $entry)
|
||||
{
|
||||
if( $entry->type !== $section )
|
||||
abort(404);
|
||||
|
||||
if( $entry->comments_thread_id)
|
||||
DeleteXenForoCommentsThread::dispatch( $entry->comments_thread_id );
|
||||
|
||||
$entry->delete();
|
||||
return redirect( route('entries.index') )->with('success', "Entry successfully deleted.");
|
||||
}
|
||||
|
||||
public function store(Request $request, string $section){
|
||||
|
||||
$request = $request->input('submit-state') === 'draft' ? app(StoreDraftRequest::class) : app(StoreEntryRequest::class);
|
||||
$request->validateResolved();
|
||||
|
||||
try {
|
||||
$entry = $this->services->storeEntry($request, $section);
|
||||
@@ -100,8 +118,11 @@ class SubmissionController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function update(StoreEntryRequest $request, string $section, Entry $entry)
|
||||
public function update(Request $request, string $section, Entry $entry)
|
||||
{
|
||||
$request = $request->input('submit-state') === 'draft' ? app(StoreDraftRequest::class) : app(StoreEntryRequest::class);
|
||||
$request->validateResolved();
|
||||
|
||||
try {
|
||||
$entry = $this->services->editEntry($request, $section, $entry);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user