spree_api 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree_api might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/v1/users_controller.rb +10 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c0e5548a962fc184efb5acee56e3349d2280f77ee6f3cec4cf96f57f1ca6790
|
4
|
+
data.tar.gz: 7179cfd1aa74207e58e54e8b6aff45110ece30b043a3d9ee57e5bc0ad31fe15b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39b32f8a83d3cad4028f6719adb391ab5b710b7049735aef350823f88116e373ba657880726c38e26f12860aaa6d850aa7a42f004b556acdf4c9bc5b45c92bca
|
7
|
+
data.tar.gz: 1086592c64ae7bbb78188e2db63295c021d5ce3f389ee79ee86cda9b50b1c8b9b7e36e67afed01f2e7463f3a920a263b999fb5dbacd297852d58640c90e42fb1
|
@@ -7,13 +7,17 @@ module Spree
|
|
7
7
|
def index
|
8
8
|
@users = Spree.user_class.accessible_by(current_ability, :show)
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if params[:ids]
|
11
|
+
@users = @users.where(id: params[:ids])
|
12
|
+
elsif params[:q]
|
13
|
+
users_with_ship_address = @users.with_address(params[:q][:ship_address_firstname_start])
|
14
|
+
users_with_bill_address = @users.with_address(params[:q][:ship_address_firstname_start], :bill_address)
|
15
15
|
|
16
|
-
|
16
|
+
users_with_addresses_ids = (users_with_ship_address.ids + users_with_bill_address.ids).compact.uniq
|
17
|
+
@users = @users.with_email_or_addresses_ids(params[:q][:email_start], users_with_addresses_ids)
|
18
|
+
end
|
19
|
+
|
20
|
+
@users = @users.page(params[:page]).per(params[:per_page])
|
17
21
|
expires_in 15.minutes, public: true
|
18
22
|
headers['Surrogate-Control'] = "max-age=#{15.minutes}"
|
19
23
|
respond_with(@users)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-rspec
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.0.
|
33
|
+
version: 4.0.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.0.
|
40
|
+
version: 4.0.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rabl
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|