fix: refactor identity data handling and improve API response mapping

This commit is contained in:
Andre_Harms 2026-02-11 16:14:49 +01:00
parent be5c3b5430
commit 8b2d76482b
7 changed files with 87 additions and 35 deletions

View file

@ -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")