diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-03-31 11:04:27 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-03-31 11:04:27 +0530 |
commit | 17f2ea5a1e2ddf6eb0d4221eed314270ac2bd34f (patch) | |
tree | 62631feaeb69309cc62d8a9a58509a81f08d4f36 /testapi/opnfv_testapi/ui/components/results/result/resultController.js | |
parent | 8d6380265299c36f6356c746460baa0cfd2ad4e1 (diff) |
Remove duplicate code in result page
Change-Id: I07d818e56aa393d4bddabb232d090bc911dd1996
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/results/result/resultController.js')
-rw-r--r-- | testapi/opnfv_testapi/ui/components/results/result/resultController.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js index d297b43..2726704 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/resultController.js +++ b/testapi/opnfv_testapi/ui/components/results/result/resultController.js @@ -21,7 +21,7 @@ ResultController.$inject = [ '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', - 'confirmModal' + 'confirmModal', 'dataFieldService' ]; /** @@ -30,11 +30,12 @@ * through result declared in TestAPI. */ function ResultController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, - raiseAlert, confirmModal) { + raiseAlert, confirmModal, dataFieldService) { var ctrl = this; ctrl.url = testapiApiUrl + '/results'; ctrl._id = $state.params['_id']; ctrl.loadDetails = loadDetails + ctrl.data_field = {} ctrl.json = {}; ctrl.json.string = '{"id": ""}'; @@ -51,6 +52,8 @@ ctrl.data = data; ctrl.object=JSON.stringify(ctrl.data.details) ctrl.json.object = JSON.parse(ctrl.object) + delete ctrl.data.details; + ctrl.data_field = dataFieldService.dataFunction(ctrl.data, ctrl.data_field) }).catch(function (error) { ctrl.data = null; ctrl.showError = true; |