lib/zendesk2/client/requests/get_organization_users.rb in zendesk2-1.5.8 vs lib/zendesk2/client/requests/get_organization_users.rb in zendesk2-1.5.9
- old
+ new
@@ -3,14 +3,17 @@
request_path { |r| "/organizations/#{r.organization_id}/users.json" }
page_params!
def organization_id
- params.fetch("organization").fetch("id")
+ params.fetch("organization").fetch("id").to_i
end
def mock
- users = self.data[:users].values.select { |u| u["organization_id"].to_i == organization_id.to_i }
+ users = self.data[:users].values.select { |u| u["organization_id"] == organization_id }
+ users += self.data[:memberships].values.select { |m|
+ m["organization_id"] == organization_id
+ }.map { |m| self.data[:users].fetch(m["user_id"]) }
page(users, root: "users")
end
end