Skip to content

Commit

Permalink
add check to delete
Browse files Browse the repository at this point in the history
  • Loading branch information
beingmattlevy committed May 13, 2024
1 parent b8b3b90 commit 53ae539
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/ticket_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def destroy
return render_flash(flash)
end

if @ticket_request.payment_received?
flash.now[:error] = 'Can not delete request when payment has been received.'
return render_flash(flash)
end

ticket_request_id = @ticket_request.id
@ticket_request.destroy if @ticket_request&.persisted?

Expand Down

0 comments on commit 53ae539

Please sign in to comment.