mozo-user connection changes
This commit is contained in:
@@ -10,7 +10,7 @@ module Users
|
||||
user = User.find_by_authentication_token(params[:auth_token])
|
||||
sign_in user if user
|
||||
sign_out current_user if current_user && !user # Other token attempt of logged in user
|
||||
else
|
||||
elsif request.format.html?
|
||||
return if Rails.env.test? and action_name == 'index'
|
||||
authenticate_user!
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ module Users
|
||||
@list = List.find(params[:list_id])
|
||||
render json: {}, status: :not_found and return unless @list.present? && Array.wrap(@list.user_ids).include?(current_user.id)
|
||||
orders = @list.orders.include_relation(:product_orders)
|
||||
render json: JSONAPI::Serializer.serialize(orders, serializer: Users::OrderSerializer, include: %w[product_orders product_orders.order], is_collection: true)
|
||||
render json: JSONAPI::Serializer.serialize(orders, serializer: Users::OrderSerializer, include: %w[list product_orders product_orders.order], is_collection: true)
|
||||
end
|
||||
|
||||
# Used by the user Ember app
|
||||
|
||||
Reference in New Issue
Block a user