@@ -78,17 +78,14 @@ func (m *imlReleaseModule) Create(ctx context.Context, serviceId string, input *
7878 return "" , fmt .Errorf ("cluster not set:%w" , err )
7979 }
8080
81- apis , err := m .apiService .ListInfoForService (ctx , proInfo .Id )
81+ apis , err := m .apiService .ListForService (ctx , proInfo .Id )
8282 if err != nil {
83- if errors .Is (err , gorm .ErrRecordNotFound ) {
84- return "" , errors .New ("api not found" )
85- }
8683 return "" , err
8784 }
8885 if len (apis ) == 0 {
8986 return "" , errors .New ("api not found" )
9087 }
91- apiUUIDS := utils .SliceToSlice (apis , func (a * api.Info ) string {
88+ apiUUIDS := utils .SliceToSlice (apis , func (a * api.API ) string {
9289 return a .UUID
9390 })
9491 apiProxy , err := m .apiService .ListLatestCommitProxy (ctx , apiUUIDS ... )
@@ -122,10 +119,10 @@ func (m *imlReleaseModule) Create(ctx context.Context, serviceId string, input *
122119 return c .Key , c .UUID
123120 })
124121 })
125-
122+ apiInfos , err := m . apiService . ListInfo ( ctx , apiUUIDS ... )
126123 var newRelease * release.Release
127124 err = m .transaction .Transaction (ctx , func (ctx context.Context ) error {
128- for _ , a := range apis {
125+ for _ , a := range apiInfos {
129126 err = m .apiService .SaveRequest (ctx , a .UUID , & api.Request {
130127 Path : a .Path ,
131128 Methods : a .Methods ,
0 commit comments