mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 19:19:15 +08:00
fix: 解决已经关联网站的分组删除没有校验的BUG
This commit is contained in:
parent
6209472fb2
commit
11b40b8cf9
@ -53,5 +53,9 @@ func (w WebsiteGroupService) UpdateGroup(update request.WebsiteGroupUpdate) erro
|
||||
}
|
||||
|
||||
func (w WebsiteGroupService) DeleteGroup(id uint) error {
|
||||
websites, _ := websiteRepo.GetBy(websiteRepo.WithGroupID(id))
|
||||
if len(websites) > 0 {
|
||||
return buserr.New(constant.ErrGroupIsUsed)
|
||||
}
|
||||
return websiteGroupRepo.DeleteBy(commonRepo.WithByID(id))
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ var (
|
||||
ErrDomainIsExist = "ErrDomainIsExist"
|
||||
ErrAliasIsExist = "ErrAliasIsExist"
|
||||
ErrAppDelete = "ErrAppDelete"
|
||||
ErrGroupIsUsed = "ErrGroupIsUsed"
|
||||
)
|
||||
|
||||
//ssl
|
||||
|
@ -33,6 +33,7 @@ ErrPathNotFound: "Path is not found"
|
||||
ErrDomainIsExist: "Domain is already exist"
|
||||
ErrAliasIsExist: "Alias is already exist"
|
||||
ErrAppDelete: 'Other Website use this App'
|
||||
ErrGroupIsUsed: 'The group has been associated with a website and cannot be deleted'
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: "The certificate is being used by the website and cannot be removed"
|
||||
|
@ -32,7 +32,8 @@ ErrPathNotFound: "目录不存在"
|
||||
#website
|
||||
ErrDomainIsExist: "域名已存在"
|
||||
ErrAliasIsExist: "代号已存在"
|
||||
ErrAppDelete: '其他网站使用此应用,不能删除'
|
||||
ErrAppDelete: '其他网站使用此应用,无法删除'
|
||||
ErrGroupIsUsed: '分组已经关联网站,无法删除'
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: "证书正在被网站使用,无法删除"
|
||||
|
Loading…
Reference in New Issue
Block a user