From a08c7f78237195240fd4f434aa56c45ceeb229f7 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 10 Feb 2023 15:52:35 +1100 Subject: [PATCH] Sort customers by id on API v1 --- app/controllers/api/v1/customers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/customers_controller.rb b/app/controllers/api/v1/customers_controller.rb index f1fcdddbf3..24bd1db8ee 100644 --- a/app/controllers/api/v1/customers_controller.rb +++ b/app/controllers/api/v1/customers_controller.rb @@ -61,7 +61,7 @@ module Api def search_customers customers = visible_customers.includes(:bill_address, :ship_address) customers = customers.where(enterprise_id: params[:enterprise_id]) if params[:enterprise_id] - customers.ransack(params[:q]).result + customers.ransack(params[:q]).result.order(:id) end def visible_customers