diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index 05e8bd726..ba421c25e 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -719,7 +719,6 @@ func getWebsiteDomains(domains string, defaultPort int, websiteID uint) (domainM } for port := range ports { - addPorts = append(addPorts, port) if existPorts, _ := websiteDomainRepo.GetBy(websiteDomainRepo.WithPort(port)); len(existPorts) == 0 { errMap := make(map[string]interface{}) errMap["port"] = port @@ -742,6 +741,9 @@ func getWebsiteDomains(domains string, defaultPort int, websiteID uint) (domainM return } } + if existPorts, _ := websiteDomainRepo.GetBy(websiteDomainRepo.WithWebsiteId(websiteID), websiteDomainRepo.WithPort(port)); len(existPorts) == 0 { + addPorts = append(addPorts, port) + } } return