Skip to content

Commit b36dca8

Browse files
committed
fix: let user delete the container reg if the ref app was deleted
1 parent eb7868a commit b36dca8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/sql/repository/pipelineConfig/CiTemplateRepository.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ func (impl CiTemplateRepositoryImpl) FindByAppId(appId int) (ciTemplate *CiTempl
9696

9797
func (impl CiTemplateRepositoryImpl) FindByDockerRegistryId(dockerRegistryId string) (ciTemplates []*CiTemplate, err error) {
9898
err = impl.dbConnection.Model(&ciTemplates).
99-
Where("docker_registry_id =? ", dockerRegistryId).
100-
Where("active = ?", true).
99+
Join("JOIN app a ON ci_template.app_id = a.id").
100+
Where("docker_registry_id = ?", dockerRegistryId).
101+
Where("ci_template.active = ?", true).
102+
Where("a.active = ?", true).
101103
Select()
102104
return ciTemplates, err
103105
}

0 commit comments

Comments
 (0)