Skip to content

Commit

Permalink
fix data_source_user config
Browse files Browse the repository at this point in the history
  • Loading branch information
cheelim1 committed Apr 20, 2023
1 parent 8d03363 commit aa55a67
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions jumpcloud/data_source_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"

jcapiv1 "github.com/TheJumpCloud/jcapi-go/v1"
jcapiv2 "github.com/TheJumpCloud/jcapi-go/v2"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
// "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
Expand All @@ -18,10 +19,6 @@ func dataSourceJumpCloudUser() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"id": {
Type: schema.TypeString,
Computed: true,
},
"username": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -71,8 +68,8 @@ func getUserDetails(client *jcapiv1.APIClient, userID, email, username string) (
}

func dataSourceJumpCloudUserRead(d *schema.ResourceData, m interface{}) error {
config := m.(*jcapiv1.Configuration)
client := jcapiv1.NewAPIClient(config)
configv1 := convertV2toV1Config(m.(*jcapiv2.Configuration))
client := jcapiv1.NewAPIClient(configv1)
userEmail := d.Get("email").(string)

// Use the getUserDetails function to query user details using the userEmail
Expand Down

0 comments on commit aa55a67

Please sign in to comment.