Small native API changes: include identity ID, return empty signup completion body
Include identity.id in the my/identity.json response and return an empty body from the CREATE signup/completions.json endpoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Rosa Gutierrez
parent
988dc637da
commit
628a43ef61
@@ -29,7 +29,7 @@ class Signups::CompletionsController < ApplicationController
|
|||||||
redirect_to landing_url(script_name: @signup.account.slug)
|
redirect_to landing_url(script_name: @signup.account.slug)
|
||||||
end
|
end
|
||||||
|
|
||||||
format.json { render json: { account_id: @signup.account.id }, status: :created }
|
format.json { head :created }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
json.id @identity.id
|
||||||
|
|
||||||
json.accounts @identity.users do |user|
|
json.accounts @identity.users do |user|
|
||||||
json.partial! "my/identities/account", account: user.account
|
json.partial! "my/identities/account", account: user.account
|
||||||
json.user user, partial: "users/user", as: :user
|
json.user user, partial: "users/user", as: :user
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class My::IdentitiesControllerTest < ActionDispatch::IntegrationTest
|
|||||||
untenanted do
|
untenanted do
|
||||||
get my_identity_path, as: :json
|
get my_identity_path, as: :json
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
assert_equal identity.id, @response.parsed_body["id"]
|
||||||
assert_equal identity.accounts.count, @response.parsed_body["accounts"].count
|
assert_equal identity.accounts.count, @response.parsed_body["accounts"].count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ class Signup::CompletionsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
assert_response :created
|
assert_response :created
|
||||||
assert_equal Account.last.id, @response.parsed_body["account_id"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "create via JSON with blank name" do
|
test "create via JSON with blank name" do
|
||||||
|
|||||||
Reference in New Issue
Block a user