Skip to content

Commit

Permalink
feat: refactor witness group
Browse files Browse the repository at this point in the history
  • Loading branch information
wai-wong-edb committed Jun 19, 2023
1 parent 6835368 commit a6f1933
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions pkg/provider/data_source_pgd.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,21 +291,16 @@ func (p pgdDataSource) Read(ctx context.Context, req datasource.ReadRequest, res
}

if apiGroupResp["clusterType"] == "witness_group" {
// apiWgModel := apiModels.ClusterWitnessGroup{}
// tfWgModel := WitnessGroupData{}
model := pgd_read.WitnessGroup{}

// if err := utils.CopyObjectJson(apiGroupResp, &apiWgModel); err != nil {
// if err != nil {
// resp.Diagnostics.AddError("Read Error", fmt.Sprintf("Unable to copy witness group, got error: %s", err))
// return
// }
// }

// if apiWgModel.Region != nil {
// tfWgModel.Region = &apiWgModel.Region.RegionId
// }
if err := utils.CopyObjectJson(apiGroupResp, &model); err != nil {
if err != nil {
resp.Diagnostics.AddError("Read Error", fmt.Sprintf("Unable to copy witness group, got error: %s", err))
return
}
}

// data.WitnessGroups = append(data.WitnessGroups, tfWgModel)
data.WitnessGroups = append(data.WitnessGroups, model)
}
}
}
Expand Down

0 comments on commit a6f1933

Please sign in to comment.