From 628a43ef6168580199a656157a09d22a15e83d52 Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Wed, 25 Feb 2026 14:21:51 +0100 Subject: [PATCH] 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 --- app/controllers/signups/completions_controller.rb | 2 +- app/views/my/identities/show.json.jbuilder | 2 ++ test/controllers/my/identities_controller_test.rb | 1 + test/controllers/signup/completions_controller_test.rb | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/signups/completions_controller.rb b/app/controllers/signups/completions_controller.rb index 0d45f2f8a..de3d81b63 100644 --- a/app/controllers/signups/completions_controller.rb +++ b/app/controllers/signups/completions_controller.rb @@ -29,7 +29,7 @@ class Signups::CompletionsController < ApplicationController redirect_to landing_url(script_name: @signup.account.slug) end - format.json { render json: { account_id: @signup.account.id }, status: :created } + format.json { head :created } end end diff --git a/app/views/my/identities/show.json.jbuilder b/app/views/my/identities/show.json.jbuilder index a36569e41..090e97dfe 100644 --- a/app/views/my/identities/show.json.jbuilder +++ b/app/views/my/identities/show.json.jbuilder @@ -1,3 +1,5 @@ +json.id @identity.id + json.accounts @identity.users do |user| json.partial! "my/identities/account", account: user.account json.user user, partial: "users/user", as: :user diff --git a/test/controllers/my/identities_controller_test.rb b/test/controllers/my/identities_controller_test.rb index 29e17cb85..392e9b547 100644 --- a/test/controllers/my/identities_controller_test.rb +++ b/test/controllers/my/identities_controller_test.rb @@ -11,6 +11,7 @@ class My::IdentitiesControllerTest < ActionDispatch::IntegrationTest untenanted do get my_identity_path, as: :json assert_response :success + assert_equal identity.id, @response.parsed_body["id"] assert_equal identity.accounts.count, @response.parsed_body["accounts"].count end end diff --git a/test/controllers/signup/completions_controller_test.rb b/test/controllers/signup/completions_controller_test.rb index fd90a6c1c..9fd3ba440 100644 --- a/test/controllers/signup/completions_controller_test.rb +++ b/test/controllers/signup/completions_controller_test.rb @@ -68,7 +68,6 @@ class Signup::CompletionsControllerTest < ActionDispatch::IntegrationTest end assert_response :created - assert_equal Account.last.id, @response.parsed_body["account_id"] end test "create via JSON with blank name" do