Skip to content

Commit

Permalink
Unmarshal user information into Viewer field
Browse files Browse the repository at this point in the history
  • Loading branch information
gwuah committed Feb 2, 2023
1 parent c6e9821 commit b0f697d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions api/resource_user.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package api

import "context"
import (
"context"
)

func (c *Client) GetCurrentUser(ctx context.Context) (*User, error) {
query := `
Expand All @@ -18,5 +20,5 @@ func (c *Client) GetCurrentUser(ctx context.Context) (*User, error) {
return nil, err
}

return &data.CurrentUser, nil
return &data.Viewer, nil
}
2 changes: 1 addition & 1 deletion api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Query struct {
AppMonitoring AppMonitoring
AppPostgres AppPostgres
AppCertsCompact AppCertsCompact
CurrentUser User
Viewer User
PersonalOrganization Organization
GqlMachine GqlMachine
Organizations struct {
Expand Down

0 comments on commit b0f697d

Please sign in to comment.