Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed Platform API endpoints (#12853)

Damian Legawiecfc4a12a73c98
diff --git a/api/app/controllers/spree/api/v2/platform/users_controller.rb b/api/app/controllers/spree/api/v2/platform/users_controller.rb
index 2368f5bd77..1df340ba78 100644
--- a/api/app/controllers/spree/api/v2/platform/users_controller.rb
+++ b/api/app/controllers/spree/api/v2/platform/users_controller.rb
@@ -25,6 +25,11 @@ module Spree
def spree_permitted_attributes
super + [:password, :password_confirmation]
end
+
+ # we need to override this method to avoid trying to create user role when creating a user
+ def ensure_current_store(_resource)
+ # do nothing
+ end
end
end
end
diff --git a/api/spec/integration/api/v2/platform/users_spec.rb b/api/spec/integration/api/v2/platform/users_spec.rb
index e9eda5ff1d..226a2697c9 100644
--- a/api/spec/integration/api/v2/platform/users_spec.rb
+++ b/api/spec/integration/api/v2/platform/users_spec.rb
@@ -11,7 +11,6 @@ describe 'Users API', swagger: true do
}
let(:id) { create(:user).id }
- let(:option_type) { create(:user, store: store) }
let(:records_list) { create_list(:user, 2) }
let(:valid_create_param_value) { build(:user).attributes }
let(:valid_update_param_value) do