1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

fix custom filter CA=0

This commit is contained in:
Sylvain 2016-07-13 10:19:43 +02:00
parent cbeb78fd7e
commit ad19bfbd79
2 changed files with 7 additions and 1 deletions

View File

@ -128,3 +128,7 @@ config(['$httpProvider', 'AuthProvider', "growlProvider", "unsavedWarningsConfig
}]).constant('angularMomentConfig', {
timezone: Fablab.timezone
});
angular.isUndefinedOrNull = function(val) {
return angular.isUndefined(val) || val === null
};

View File

@ -515,7 +515,9 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state",
##
buildCustomFilterQuery = ->
custom = null
if $scope.customFilter.criterion and $scope.customFilter.criterion.key and $scope.customFilter.value
if !angular.isUndefinedOrNull($scope.customFilter.criterion) and
!angular.isUndefinedOrNull($scope.customFilter.criterion.key) and
!angular.isUndefinedOrNull($scope.customFilter.value)
custom = {}
custom.key = $scope.customFilter.criterion.key
custom.value = $scope.customFilter.value