fix: refactor identity data handling and improve API response mapping
This commit is contained in:
parent
be5c3b5430
commit
8b2d76482b
7 changed files with 87 additions and 35 deletions
|
|
@ -140,7 +140,7 @@ func mapFieldsCreate(userResp *sqlserverflexalpha.CreateUserResponse, model *res
|
|||
if user.Roles != nil {
|
||||
var roles []attr.Value
|
||||
for _, role := range *user.Roles {
|
||||
roles = append(roles, types.StringValue(string(role)))
|
||||
roles = append(roles, types.StringValue(role))
|
||||
}
|
||||
rolesSet, diags := types.SetValue(types.StringType, roles)
|
||||
if diags.HasError() {
|
||||
|
|
@ -165,7 +165,7 @@ func mapFieldsCreate(userResp *sqlserverflexalpha.CreateUserResponse, model *res
|
|||
// toCreatePayload converts a resourceModel to an API CreateUserRequestPayload.
|
||||
func toCreatePayload(
|
||||
model *resourceModel,
|
||||
roles []sqlserverflexalpha.UserRole,
|
||||
roles []string,
|
||||
) (*sqlserverflexalpha.CreateUserRequestPayload, error) {
|
||||
if model == nil {
|
||||
return nil, fmt.Errorf("nil model")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue