fix: fix gift recipient relation (#1754)

This commit is contained in:
Alexis Saettler
2018-08-31 19:33:44 +02:00
committed by GitHub
parent be3b6dd710
commit e97bad8ef6
4 changed files with 125 additions and 4 deletions
@@ -172,7 +172,9 @@ class GiftsController extends Controller
$gift->update($array);
}
if ($request->get('has_recipient')) {
if ($request->get('has_recipient')
&& Contact::where('account_id', auth()->user()->account_id)
->find($request->get('recipient')) != null) {
$gift->recipient = $request->get('recipient');
$gift->save();
}