Skip to content

Commit 50891b8

Browse files
authored
Return a collection of WorkOS::Organization from list_organizations (#57)
* An issue in our earlier implementation was returning the raw response without wrapping it in our helper object. This commit makes the breaking change to now return the WorkOS::Organization instance automatically. * Bump to 0.8.0
1 parent bf27cb5 commit 50891b8

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
workos (0.7.0)
4+
workos (0.8.0)
55
require_all (~> 3.0.0)
66
sorbet-runtime (~> 0.5)
77

lib/workos/portal.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ def list_organizations(options = {})
103103

104104
parsed_response = JSON.parse(response.body)
105105

106+
organizations = parsed_response['data'].map do |organization|
107+
::WorkOS::Organization.new(organization.to_json)
108+
end
109+
106110
WorkOS::Types::ListStruct.new(
107-
data: parsed_response['data'],
111+
data: organizations,
108112
list_metadata: parsed_response['listMetadata'],
109113
)
110114
end

lib/workos/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# typed: strong
33

44
module WorkOS
5-
VERSION = '0.7.0'
5+
VERSION = '0.8.0'
66
end

0 commit comments

Comments
 (0)