Refactor for mobile deployment
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Users
|
||||
class ApplicationController < ::ApplicationController
|
||||
before_action :allow_all_origins
|
||||
before_action :user_authentication, :unless => ->(c){ %w(obtain_token).include?(c.action_name) || c.request.format.symbol == :html } # , except: [:obtain_token, :index]
|
||||
|
||||
private
|
||||
|
||||
@@ -3,9 +3,9 @@ module Users
|
||||
|
||||
def index
|
||||
#lists = current_user.lists.include_relation(:supplier, :table)
|
||||
lists = List.for_user(current_user, page: params[:page], per_page: params[:per_page].presence || 25).include_relation(:supplier, :table)
|
||||
lists = List.for_user(current_user, page: params[:page], per_page: params[:per_page].presence || 25)
|
||||
#lists.include_relation(:supplier)
|
||||
lists.include_relation(:users, :orders)
|
||||
lists.include_relation(:users, :orders, :supplier, :table)
|
||||
render json: lists, each_serializer: UserListSerializer, meta: {total_pages: lists.total_pages, page: lists.current_page} #, root: :lists
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user