Skip to content

Commit

Permalink
update: return value to struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Herdanis committed Dec 6, 2024
1 parent d531cce commit 5d31305
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4508,16 +4508,19 @@ func (g *GoCloak) GetUsersManagementPermissions(ctx context.Context, accessToken
return &result, nil
}

func (g *GoCloak) CreateOrganization(ctx context.Context, token, realm string, organization Organization) (string, error) {
func (g *GoCloak) CreateOrganization(ctx context.Context, token, realm string, organization Organization) (*Organization, error) {
const errMessage = "could not create organization"

var result Organization

resp, err := g.GetRequestWithBearerAuth(ctx, token).
SetResult(&result).
SetBody(organization).
Post(g.getAdminRealmURL(realm, "organizations"))

if err := checkForError(resp, err, errMessage); err != nil {
return "", err
return nil, err
}

return getID(resp), nil
return &result, nil
}

0 comments on commit 5d31305

Please sign in to comment.