Skip to content

Commit cf90893

Browse files
FIX: App labels add in app clone (#669)
* api spec added for app labels api's * open api spec updated for app labels * spec added for create api and app listing and refactored app labels spec * spec added for create api and app listing and refactored app labels spec * modification in app listing open api spec * app label api added * open api spec for app labels review changes * labels changes to key values wip * labels changes to key values wip * db migration script added for app labels * db script change for app label * app label api fix * repo error fixed for app labels * code refactored and transaction for app labels * db migration renamed 15 to 16 * duplicate key check added, removed validation component * delete or untag labels from application * app label meta api app id remove in response * app label meta api app id remove in response, struct changes * unique key constraints removed for app labels * review changes app labels - doc updated with visuals * labels added on app clone request
1 parent 69b5597 commit cf90893

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pkg/appClone/AppCloneService.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ func NewAppCloneServiceImpl(logger *zap.SugaredLogger,
7070
}
7171

7272
type CloneRequest struct {
73-
RefAppId int `json:"refAppId"`
74-
Name string `json:"name"`
75-
ProjectId int `json:"projectId"`
73+
RefAppId int `json:"refAppId"`
74+
Name string `json:"name"`
75+
ProjectId int `json:"projectId"`
76+
AppLabels []*bean.Label `json:"labels,omitempty" validate:"dive"`
7677
}
7778

7879
func (impl *AppCloneServiceImpl) CloneApp(createReq *bean.CreateAppDTO, context context.Context) (*bean.CreateAppDTO, error) {
@@ -81,6 +82,7 @@ func (impl *AppCloneServiceImpl) CloneApp(createReq *bean.CreateAppDTO, context
8182
RefAppId: createReq.TemplateId,
8283
Name: createReq.AppName,
8384
ProjectId: createReq.TeamId,
85+
AppLabels: createReq.AppLabels,
8486
}
8587
userId := createReq.UserId
8688
appStatus, err := impl.appListingService.FetchAppStageStatus(cloneReq.RefAppId)
@@ -179,9 +181,10 @@ func (impl *AppCloneServiceImpl) CloneApp(createReq *bean.CreateAppDTO, context
179181

180182
func (impl *AppCloneServiceImpl) CreateApp(cloneReq *CloneRequest, userId int32) (*bean.CreateAppDTO, error) {
181183
createAppReq := &bean.CreateAppDTO{
182-
AppName: cloneReq.Name,
183-
UserId: userId,
184-
TeamId: cloneReq.ProjectId,
184+
AppName: cloneReq.Name,
185+
UserId: userId,
186+
TeamId: cloneReq.ProjectId,
187+
AppLabels: cloneReq.AppLabels,
185188
}
186189
createRes, err := impl.pipelineBuilder.CreateApp(createAppReq)
187190
return createRes, err

0 commit comments

Comments
 (0)