@Lvc, Below is the client code (AngularJS) used.
$scope.getInitialData = function() {
if (window.appInitialized) {
return;
}
window.appInitialized = true;
// Get all businesses of logged-in user
url = $scope.getAbsoluteBackendURL('function/fsdb/getbusinessesofmerchant');
$http.get(url)
.success(function(data, status) {
if ((status == "200") && (data.result.length) && (data.result.length > 0)) {
data.result = cleanJSON(data.result);
$scope.businesses = data.result;
} else {
$scope.businesses = [];
}
})
.error($scope.ajaxErrorHandler);
// Get all products of logged-in user
url = $scope.getAbsoluteBackendURL('function/fsdb/getproductsofmerchant');
$http.get(url)
.success(function(data, status) {
if ((status == "200") && (data.result.length) && (data.result.length > 0)) {
data.result = cleanJSON(data.result);
$scope.products = data.result;
} else {
$scope.products = [];
}
})
.error($scope.ajaxErrorHandler);
// Get all base products in DB, across all vendors.
url = $scope.getAbsoluteBackendURL('function/fsdb/getallbaseproducts');
$http.get(url)
.success(function(data, status) {
if ((status == "200") && (data.result.length) && (data.result.length > 0)) {
data.result = cleanJSON(data.result);
$scope.baseProducts = data.result;
} else {
$scope.baseProducts = [];
}
})
.error($scope.ajaxErrorHandler);
// Get all master countries
url = $scope.getAbsoluteBackendURL('function/fsdb/getallcountries');
$http.get(url)
.success(function(data, status) {
if ((status == "200") && (data.result.length) && (data.result.length > 0)) {
data.result = cleanJSON(data.result);
$scope.masterCountries = data.result;
alert("No. of Countries - "+data.result.length);
} else {
$scope.masterCountries = [];
}
})
.error($scope.ajaxErrorHandler);
};
I hope it will help you to reproduce the issue.