Skip to content

Commit e68facc

Browse files
Update handler to remove model
1 parent 0278d0e commit e68facc

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

  • cfn-resources/backup-compliance-policy/cmd/resource

cfn-resources/backup-compliance-policy/cmd/resource/handlers.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ func HandleUpdate(req *handler.Request, client *util.MongoDBClient, model *Model
166166

167167
_, apiResp, err = client.AtlasSDK.CloudBackupsApi.UpdateCompliancePolicyWithParams(ctx, &params).Execute()
168168
if err != nil {
169+
if isPendingActionError(err) {
170+
return handlePendingAction(ctx, client, model, projectID)
171+
}
169172
return handleError(apiResp, constants.UPDATE, err)
170173
}
171174

@@ -233,26 +236,24 @@ func HandleList(req *handler.Request, client *util.MongoDBClient, model *Model)
233236
return handler.ProgressEvent{
234237
OperationStatus: handler.Success,
235238
Message: constants.Complete,
236-
ResourceModels: []interface{}{},
239+
ResourceModels: []any{},
237240
}
238241
}
239242

240243
if policy != nil && policy.GetProjectId() == "" {
241244
return handler.ProgressEvent{
242245
OperationStatus: handler.Success,
243246
Message: constants.Complete,
244-
ResourceModels: []interface{}{},
247+
ResourceModels: []any{},
245248
}
246249
}
247250

248-
listModel := &Model{ProjectId: &projectID}
249-
SetBackupCompliancePolicyData(listModel, policy)
250-
model = listModel
251+
SetBackupCompliancePolicyData(model, policy)
251252

252253
return handler.ProgressEvent{
253254
OperationStatus: handler.Success,
254255
Message: constants.Complete,
255-
ResourceModels: []interface{}{model},
256+
ResourceModels: []any{model},
256257
}
257258
}
258259

0 commit comments

Comments
 (0)