From 092cba95b42d200799c2d88140fb0f9026176f6d Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 수, 26 1월 2022 16:58:16 +0900
Subject: [PATCH] - 이슈 수정 시 대분류만 선택하고 수정 시 오류 해결 - 전체댓글+메일보기/하위이슈 댓글+메일보기 - 이슈 엑셀 임포트시 오류 해결

---
 src/main/webapp/scripts/app/issue/issueAddRelation.controller.js |   54 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js b/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js
index feda0af..5fc35f8 100644
--- a/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js
@@ -528,30 +528,36 @@
 
                 // ISP�젙蹂� 寃곌낵 媛� Event 泥섎━(set)
                 $scope.$on("ispFieldEvent", function (event, result) {
-                    $scope.vm.ispId = result[0].id;
-                    $scope.vm.ispName = result[0].name;
-                    $scope.vm.ispCode = result[0].code;
-                    $scope.vm.ispManager = result[0].manager;
-                    $scope.vm.ispTel = result[0].tel;
-                    $scope.vm.ispEmail = result[0].email;
-                    $scope.vm.ispUrl = result[0].url;
-                    $scope.vm.ispMemo = result[0].memo;
+                    if ($rootScope.isDefined(result[0])) {
+                        $scope.vm.ispId = result[0].id;
+                        $scope.vm.ispName = result[0].name;
+                        $scope.vm.ispCode = result[0].code;
+                        $scope.vm.ispManager = result[0].manager;
+                        $scope.vm.ispTel = result[0].tel;
+                        $scope.vm.ispEmail = result[0].email;
+                        $scope.vm.ispUrl = result[0].url;
+                        $scope.vm.ispMemo = result[0].memo;
+                    }
                 });
 
                 // �샇�뒪�똿�젙蹂� 寃곌낵 媛� Event 泥섎━(set)
                 $scope.$on("hostingFieldEvent", function (event, result) {
-                    $scope.vm.hostingId = result[0].id;
-                    $scope.vm.hostingName = result[0].name;
-                    $scope.vm.hostingCode = result[0].code;
-                    $scope.vm.hostingManager = result[0].manager;
-                    $scope.vm.hostingTel = result[0].tel;
-                    $scope.vm.hostingEmail = result[0].email;
-                    $scope.vm.hostingUrl = result[0].url;
-                    $scope.vm.hostingMemo = result[0].memo;
+                    if ($rootScope.isDefined(result[0])) {
+                        $scope.vm.hostingId = result[0].id;
+                        $scope.vm.hostingName = result[0].name;
+                        $scope.vm.hostingCode = result[0].code;
+                        $scope.vm.hostingManager = result[0].manager;
+                        $scope.vm.hostingTel = result[0].tel;
+                        $scope.vm.hostingEmail = result[0].email;
+                        $scope.vm.hostingUrl = result[0].url;
+                        $scope.vm.hostingMemo = result[0].memo;
+                    }
                 });
 
                 $scope.$on("companyTypeEvent", function (event, result) {
-                    $scope.vm.form.companyTypeId = result[0].id;
+                    if ($rootScope.isDefined(result[0])) {
+                        $scope.vm.form.companyTypeId = result[0].id;
+                    }
                 });
                 $scope.$on("parentSectorEvent", function (event, result) {
                     if ($rootScope.isDefined(result[0])) {
@@ -562,13 +568,19 @@
                     $scope.vm.form.childSectors = [];
                 });
                 $scope.$on("childSectorEvent", function (event, result) {
-                    $scope.vm.form.childSectorId = result[0].id;
+                    if ($rootScope.isDefined(result[0])) {
+                        $scope.vm.form.childSectorId = result[0].id;
+                    }
                 });
                 $scope.$on("regionEvent", function (event, result) {
-                    $scope.vm.form.regionId = result[0].id;
+                    if ($rootScope.isDefined(result[0])) {
+                        $scope.vm.form.regionId = result[0].id;
+                    }
                 });
                 $scope.$on("statusEvent", function (event, result) {
-                    $scope.vm.form.statusId = result[0].id;
+                    if ($rootScope.isDefined(result[0])) {
+                        $scope.vm.form.statusId = result[0].id;
+                    }
                 });
 
                 //  �뤌 �쟾�넚
@@ -655,7 +667,7 @@
 
                         companyId : (function () {
                             var companyId = -1;
-                            if ($scope.vm.form.issueCompanyFields.length > 0) {
+                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0) {
                                 companyId = $scope.vm.form.issueCompanyFields[0].id;
                             }
                             return companyId;

--
Gitblit v1.8.0