Skip to content

Commit

Permalink
#1288 Use observable datatypes dedicated API when dealing with datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed May 22, 2020
1 parent 460aa4e commit 5dfb938
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

angular.module('theHiveControllers').controller('AdminCustomFieldsCtrl',
function($scope, $uibModal, ListSrv, CustomFieldsSrv, NotificationSrv, ModalUtilsSrv) {
function($scope, $uibModal, CustomFieldsSrv, NotificationSrv, ModalUtilsSrv) {
var self = this;

self.reference = {
Expand Down
17 changes: 9 additions & 8 deletions frontend/app/scripts/controllers/case/ObservableCreationCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'use strict';

angular.module('theHiveControllers').controller('ObservableCreationCtrl',
function($scope, $stateParams, $uibModalInstance, clipboard, CaseArtifactSrv, ListSrv, NotificationSrv, TagSrv, params) {
function($scope, $stateParams, $uibModalInstance, clipboard, CaseArtifactSrv, ObservableTypeSrv, NotificationSrv, TagSrv, params) {

$scope.activeTlp = 'active';
$scope.pendingAsync = false;
Expand All @@ -29,13 +29,14 @@
});

$scope.getDataTypeList = function() {
ListSrv.query({
listId: 'list_artifactDataType'
}, function(data) {
$scope.types = _.filter(_.values(data), _.isString).sort();
}, function(response) {
NotificationSrv.error('ObservableCreationCtrl', response.data, response.status);
});

ObservableTypeSrv.list()
.then(function(response) {
$scope.types = _.pluck(response.data, 'name').sort();
})
.catch(function(err) {
NotificationSrv.error('ObservableCreationCtrl', err.data, err.status);
});
};
$scope.getDataTypeList();
$scope.updateTlp = function(tlp) {
Expand Down

0 comments on commit 5dfb938

Please sign in to comment.