Added more filtering for appeal check
Appeal checks needed an emptry string filter so all requested data is accounted for and not left emptyAdded more filtering for appeal check
This commit is contained in:
parent
da0ddb3ef0
commit
9e7c7c584e
1 changed files with 21 additions and 12 deletions
|
@ -30,7 +30,16 @@ class AppealController extends Controller
|
||||||
'error' => 'Appeal already in process for Location',
|
'error' => 'Appeal already in process for Location',
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
//TODO: Add empty string filtering and check if location exists in DB
|
if (
|
||||||
|
empty($request->location)
|
||||||
|
|| empty($request->location_admin)
|
||||||
|
|| empty($request->sponsor)
|
||||||
|
|| empty($request->appeal_description)
|
||||||
|
) {
|
||||||
|
return back()->withErrors([
|
||||||
|
'error' => 'All fields are required',
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
$new = Appeal::create([
|
$new = Appeal::create([
|
||||||
'uuid' => Uuid::uuid4(),
|
'uuid' => Uuid::uuid4(),
|
||||||
'location' => $request->location,
|
'location' => $request->location,
|
||||||
|
@ -42,7 +51,7 @@ class AppealController extends Controller
|
||||||
]);
|
]);
|
||||||
Mail::to(env('TBS_ADMIN_EMAIL'))->send(new LocationAppeal($request->location, $request->sponsor));
|
Mail::to(env('TBS_ADMIN_EMAIL'))->send(new LocationAppeal($request->location, $request->sponsor));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//return redirect('/appeals');
|
//return redirect('/appeals');
|
||||||
return back()->with('message', "Appeal Filed");
|
return back()->with('message', "Appeal Filed");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue