Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PT-13362: use default search or indexed search #386

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function ($rootScope, $scope, $localStorage, customerOrders, bladeUtils, dialogS
var blade = $scope.blade;
var bladeNavigationService = bladeUtils.bladeNavigationService;
$scope.uiGridConstants = uiGridConstants;
$scope.useIndexedSearch = false;

$scope.getPricesVisibility = () => authService.checkPermission('order:read_prices');

Expand Down Expand Up @@ -70,7 +71,9 @@ function ($rootScope, $scope, $localStorage, customerOrders, bladeUtils, dialogS
angular.extend(criteria, filter.current);
}

customerOrders.search(criteria, function (data) {
var endpoint = $scope.useIndexedSearch ? customerOrders.indexedSearch : customerOrders.search;

endpoint(criteria, function (data) {
blade.isLoading = false;

$scope.pageSettings.totalItems = data.totalCount;
Expand Down Expand Up @@ -229,6 +232,10 @@ function ($rootScope, $scope, $localStorage, customerOrders, bladeUtils, dialogS
return gridOptions;
};

customerOrders.indexedSearchEnabled(function (data) {
$scope.useIndexedSearch = data.result;
});


// actions on load
//No need to call this because page 'pageSettings.currentPage' is watched!!! It would trigger subsequent duplicated req...
Expand Down
Loading