From 3fea1255bc7069b8be3c12dd1cb845bae20019bd Mon Sep 17 00:00:00 2001 From: d4x1 <1507509064@qq.com> Date: Tue, 30 Jul 2024 18:30:31 +0800 Subject: [PATCH] fix(domainlayer): simplify codes --- backend/core/models/domainlayer/ticket/issue.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/backend/core/models/domainlayer/ticket/issue.go b/backend/core/models/domainlayer/ticket/issue.go index 816571a4a47..25039e8df91 100644 --- a/backend/core/models/domainlayer/ticket/issue.go +++ b/backend/core/models/domainlayer/ticket/issue.go @@ -18,7 +18,6 @@ limitations under the License. package ticket import ( - "errors" "github.com/apache/incubator-devlake/core/models/domainlayer" "time" ) @@ -111,9 +110,6 @@ func (issue Issue) IsIncident() bool { } func (issue Issue) ToIncidentAssignee() (*IncidentAssignee, error) { - if !issue.IsIncident() { - return nil, errors.New("issue type is not INCIDENT, cannot generate incident_assignee") - } return &IncidentAssignee{ IncidentId: issue.Id, AssigneeId: issue.AssigneeId, @@ -123,9 +119,6 @@ func (issue Issue) ToIncidentAssignee() (*IncidentAssignee, error) { } func (issue Issue) ToIncident() (*Incident, error) { - if !issue.IsIncident() { - return nil, errors.New("issue type is not INCIDENT, cannot generate incident") - } incident := &Incident{ DomainEntity: issue.DomainEntity, Url: issue.Url,