Skip to content

Commit

Permalink
Fix user attribute user value delete (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: hirosassa <[email protected]>
  • Loading branch information
marcoquerque and hirosassa authored Sep 7, 2022
1 parent 9ebec06 commit d61d70b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/looker/resource_user_attribute_user_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package looker

import (
"context"
"log"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -124,13 +125,11 @@ func resourceUserAttributeUserValueDelete(ctx context.Context, d *schema.Resourc
return diag.FromErr(err)
}

body := apiclient.WriteUserAttributeWithValue{
Value: nil,
}
log.Printf("[DEBUG] Delete user attribute user value %s for %s", userAttributeID, userID)

// fill the target value null
_, err = client.SetUserAttributeUserValue(userID, userAttributeID, body, nil)
err = client.DeleteUserAttributeUserValue(userID, userAttributeID, nil)
if err != nil {
log.Printf("[DEBUG] %+v", err)
return diag.FromErr(err)
}

Expand Down

0 comments on commit d61d70b

Please sign in to comment.