Load all shops that a user is associated with as a customer

Regardless of the presence of an order
This commit is contained in:
Rob Harrington
2018-06-22 15:34:17 +10:00
parent 5e6291bce3
commit ddb9ae1140
4 changed files with 20 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
module Api
class CustomersController < BaseController
def index
@customers = current_api_user.customers
@customers = current_api_user.customers.of_regular_shops
render json: @customers, each_serializer: CustomerSerializer
end