summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/organization_endpoint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/endpoints/organization_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/organization_endpoint.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/chef_zero/endpoints/organization_endpoint.rb b/lib/chef_zero/endpoints/organization_endpoint.rb
index bc5c3f0..fbc6610 100644
--- a/lib/chef_zero/endpoints/organization_endpoint.rb
+++ b/lib/chef_zero/endpoints/organization_endpoint.rb
@@ -16,13 +16,19 @@ module ChefZero
new_org.each do |key, value|
org[key] = value
end
- org = FFI_Yajl::Encoder.encode(org, :pretty => true)
+ save_org = FFI_Yajl::Encoder.encode(org, :pretty => true)
if new_org['name'] != request.rest_path[-1]
# This is a rename
return error(400, "Cannot rename org #{request.rest_path[-1]} to #{new_org['name']}: rename not supported for orgs")
end
- set_data(request, request.rest_path + [ 'org' ], org)
- json_response(200, "uri" => "#{build_uri(request.base_uri, request.rest_path)}")
+ set_data(request, request.rest_path + [ 'org' ], save_org)
+ pp org
+ json_response(200, {
+ "uri" => "#{build_uri(request.base_uri, request.rest_path)}",
+ "name" => org['name'],
+ "org_type" => org['org_type'],
+ "full_name" => org['full_name']
+ })
end
def delete(request)