From 2247697f68869e46e312834de06c8292bc156f68 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 16 Dec 2017 22:29:56 +0200 Subject: [PATCH] Handle already approved quote --- app/Http/Controllers/QuoteController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 93ee5f599b06..27eed69b6442 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -156,9 +156,11 @@ class QuoteController extends BaseController } } - $invitationKey = $this->invoiceService->approveQuote($invoice, $invitation); - Session::flash('message', trans('texts.quote_is_approved')); - - return Redirect::to("view/{$invitationKey}"); + if ($invoiceInvitationKey = $this->invoiceService->approveQuote($invoice, $invitation)) { + Session::flash('message', trans('texts.quote_is_approved')); + return Redirect::to("view/{$invoiceInvitationKey}"); + } else { + return Redirect::to("view/{$invitationKey}"); + } } }