Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ksavosteev committed Jul 9, 2024
1 parent 65b735c commit 3125c91
Showing 1 changed file with 36 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
angular.module('virtoCommerce.orderModule')
.controller('virtoCommerce.orderModule.customerOrderListWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', 'virtoCommerce.orderModule.order_res_customerOrders',
function ($scope, bladeNavigationService, customerOrders) {
var blade = $scope.widget.blade;
.controller('virtoCommerce.orderModule.customerOrderListWidgetController',
['$scope', 'platformWebApp.bladeNavigationService', 'virtoCommerce.orderModule.order_res_customerOrders',
function ($scope, bladeNavigationService, customerOrders) {
var blade = $scope.widget.blade;

var searchCriteria = {};
if (blade.currentEntity) {
if (blade.currentEntity.memberType === "Organization") {
searchCriteria.organizationId = blade.currentEntityId;
}
else {
var account = _.first(blade.currentEntity.securityAccounts)
if (account) {
searchCriteria.customerId = account.id;
var searchCriteria = {};
if (blade.currentEntity) {
if (blade.currentEntity.memberType === "Organization") {
searchCriteria.organizationId = blade.currentEntityId;
}
else {
var account = _.first(blade.currentEntity.securityAccounts)
if (account) {
searchCriteria.customerId = account.id;
}
}
}
}

function refresh() {
$scope.ordersCount = '...';
function refresh() {
$scope.ordersCount = '...';

var countSearchCriteria = {
responseGroup: "Default",
take: 0
};
var countSearchCriteria = {
responseGroup: "Default",
take: 0
};

angular.extend(countSearchCriteria, searchCriteria);
angular.extend(countSearchCriteria, searchCriteria);

customerOrders.search(countSearchCriteria, function (data) {
$scope.ordersCount = data.totalCount;
});
}
customerOrders.search(countSearchCriteria, function (data) {
$scope.ordersCount = data.totalCount;
});
}

$scope.openBlade = function () {
var newBlade = {
id: 'orders',
title: 'orders.blades.customerOrder-list.title',
searchCriteria: searchCriteria,
controller: 'virtoCommerce.orderModule.customerOrderListController',
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-list.tpl.html'
$scope.openBlade = function () {
var newBlade = {
id: 'orders',
title: 'orders.blades.customerOrder-list.title',
searchCriteria: searchCriteria,
controller: 'virtoCommerce.orderModule.customerOrderListController',
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-list.tpl.html'
};
bladeNavigationService.showBlade(newBlade, blade);
};
bladeNavigationService.showBlade(newBlade, blade);
};

refresh()
}]);
refresh()
}]);

0 comments on commit 3125c91

Please sign in to comment.