Verified Commit 7f0124a9 authored by Korko's avatar Korko
Browse files

Remove support of non ajax, never tested

parent dd8e580c
......@@ -69,11 +69,9 @@ class OrganizerController extends Controller
$this->sendEmail($participant);
return $request->ajax() ?
response()->json([
'message' => $message, 'participant' => $participant->only(['id', 'mail']),
]) :
redirect('/')->with('message', $message);
return response()->json([
'message' => $message, 'participant' => $participant->only(['id', 'mail']),
]);
}
protected function sendEmail(Participant $participant)
......@@ -117,12 +115,8 @@ class OrganizerController extends Controller
{
$draw->delete();
$message = trans('organizer.deleted');
return $request->ajax() ?
response()->json([
'message' => $message,
]) :
redirect('/')->with('message', $message);
return response()->json([
'message' => trans('organizer.deleted'),
]);
}
}
......@@ -20,17 +20,13 @@ class RandomFormController extends Controller
try {
$this->drawAndInform($request);
$message = trans('message.sent');
return $request->ajax() ?
response()->json(['message' => $message]) :
redirect('/')->with('message', $message);
return response()->json([
'message' => trans('message.sent')
]);
} catch (SolverException $e) {
$error = trans('error.solution');
return $request->ajax() ?
response()->json(['error' => $error], 500) :
redirect('/')->with('error', $error);
return response()->json([
'message' => trans('error.solution')
], 500);
}
}
......
Supports Markdown
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