Verified Commit a584827e authored by Korko's avatar Korko
Browse files

Add route to delete draw

parent ed6d08f8
......@@ -78,4 +78,17 @@ class OrganizerController extends Controller
SendMail::dispatch($participant, new TargetDrawn($participant));
}
public function delete(Draw $draw)
{
$draw->delete();
$message = trans('organizer.deleted');
return $request->ajax() ?
response()->json([
'message' => $message,
]) :
redirect('/')->with('message', $message);
}
}
......@@ -7,4 +7,5 @@ return [
'status' => "Status de réception de l'email",
],
'up_and_sent' => 'Modifié avec succès !',
'deleted' => 'Toutes les données ont été supprimées',
];
......@@ -32,6 +32,7 @@ Route::pattern('draw', '[0-9a-zA-Z]{'.config('hashids.connections.draw.length').
Route::get('/org/{draw}', 'OrganizerController@view')->name('organizerPanel');
Route::middleware(['decrypt.key'])->group(function () {
Route::post('/org/{draw}', 'OrganizerController@fetch')->name('organizerPanel.fetch');
Route::delete('/org/{draw}', 'OrganizerController@delete')->name('organizerPanel.delete');
Route::post('/org/{draw}/fetchState', 'OrganizerController@fetchState')->name('organizerPanel.fetchState');
Route::post('/org/{draw}/{participant}/changeEmail', 'OrganizerController@changeEmail')->name('organizerPanel.changeEmail');
Route::post('/org/{draw}/{participant}/resendEmail', 'OrganizerController@resendEmail')->name('organizerPanel.resendEmail');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment