Implement waiter ordering and improvements
This commit is contained in:
@@ -286,12 +286,12 @@ class UserController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to(user_root_path, alert: t('messages.cannot_order_on_non_active_list')) and return unless @list.active?
|
||||
@list.place_order current_user, params[:products]
|
||||
@list.place_order params[:products], user: current_user
|
||||
redirect_to user_root_path, notice: t('messages.order_is_placed')
|
||||
end
|
||||
format.json do
|
||||
render json: json_alert('messages.cannot_order_on_non_active_list') and return unless @list.active?
|
||||
@list.place_order current_user, params[:products]
|
||||
@list.place_order params[:products], user: current_user
|
||||
render json: json_notice('messages.order_is_placed', location: :active_list)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user