Skip to content

Commit

Permalink
Price calculator clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Jun 10, 2024
1 parent a764a5b commit df5b24c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/Livewire/PriceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function showPriceModal(): void
$this->calculatePrice();
$this->showModal = true;
$this->dispatch('toggleModal', true);

if (!auth()->check()) {
session()->flash('error', 'You need to login or register to place an order');
}
}

public function closeModal(): void
Expand Down Expand Up @@ -95,13 +99,10 @@ public function placeOrder()

// redirect to the order creation page
if (!auth()->check()) {
$message = 'You need to login or register to place an order';
session()->flash('error', $message);
}else{
$message = 'Order placed successfully';
session()->flash('error', 'You need to login or register to place an order');
}

return redirect()->route('orders.create.new')->with('success', $message);
return redirect()->route('orders.create.new');
}

public function render(): View
Expand Down

0 comments on commit df5b24c

Please sign in to comment.