spree_api 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c06616261ed0cce0d2551640447d3c430c953ed35e37431301c61bae2e3dac8a
|
4
|
+
data.tar.gz: 81a74ac3a07b00a30f37340a9dde83c1af165eaa975f2d02db199b24ac5a4463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87aa9550f3cdb1e7512451e458a55890f69f66c82f688ab45cc6a235b99b47713ac6baf93edc6db7e4605b6c06f34ebf66d63be033567534d2e78d5b3c4440c9
|
7
|
+
data.tar.gz: 9ec6f55ed3f69115f2dce5e6e1d88c650047b15aec26c95a892c1a86ada28b46084070cc9d1f96752ac54f7bd1bcd7553d2ce7c8d7abe88a0b1ea816e61429ce
|
@@ -11,6 +11,9 @@ module Spree
|
|
11
11
|
rescue_from CanCan::AccessDenied, with: :access_denied
|
12
12
|
rescue_from Spree::Core::GatewayError, with: :gateway_error
|
13
13
|
rescue_from ActionController::ParameterMissing, with: :error_during_processing
|
14
|
+
if defined?(JSONAPI::Serializer::UnsupportedIncludeError)
|
15
|
+
rescue_from JSONAPI::Serializer::UnsupportedIncludeError, with: :error_during_processing
|
16
|
+
end
|
14
17
|
rescue_from ArgumentError, with: :error_during_processing
|
15
18
|
|
16
19
|
def content_type
|
@@ -7,15 +7,29 @@ module Spree
|
|
7
7
|
before_action :require_spree_current_user
|
8
8
|
|
9
9
|
def create
|
10
|
+
spree_authorize! :create, model_class
|
11
|
+
|
10
12
|
result = create_service.call(user: spree_current_user, address_params: address_params)
|
11
13
|
render_result(result)
|
12
14
|
end
|
13
15
|
|
14
16
|
def update
|
17
|
+
spree_authorize! :update, resource
|
18
|
+
|
15
19
|
result = update_service.call(address: resource, address_params: address_params)
|
16
20
|
render_result(result)
|
17
21
|
end
|
18
22
|
|
23
|
+
def destroy
|
24
|
+
spree_authorize! :destroy, resource
|
25
|
+
|
26
|
+
if resource.destroy
|
27
|
+
head 204
|
28
|
+
else
|
29
|
+
render_error_payload(resource.errors)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
19
33
|
private
|
20
34
|
|
21
35
|
def collection
|
data/config/routes.rb
CHANGED
@@ -152,7 +152,7 @@ Spree::Core::Engine.add_routes do
|
|
152
152
|
resource :account, controller: :account, only: %i[show]
|
153
153
|
|
154
154
|
namespace :account do
|
155
|
-
resources :addresses, controller: :addresses
|
155
|
+
resources :addresses, controller: :addresses
|
156
156
|
resources :credit_cards, controller: :credit_cards, only: %i[index show]
|
157
157
|
resources :orders, controller: :orders, only: %i[index show]
|
158
158
|
end
|
@@ -239,6 +239,21 @@ paths:
|
|
239
239
|
security:
|
240
240
|
- bearerAuth: []
|
241
241
|
'/api/v2/storefront/account/addresses/{id}':
|
242
|
+
delete:
|
243
|
+
description: 'Removes selected Address for the signed in User. It uses soft-delete for addresses with shipments and orders.'
|
244
|
+
tags:
|
245
|
+
- Account
|
246
|
+
operationId: Remove Address
|
247
|
+
parameters:
|
248
|
+
- $ref: '#/components/parameters/AddressId'
|
249
|
+
responses:
|
250
|
+
'204':
|
251
|
+
description: Requested Address has been removed from the User Account
|
252
|
+
'404':
|
253
|
+
$ref: '#/components/responses/404NotFound'
|
254
|
+
security:
|
255
|
+
- bearerAuth: []
|
256
|
+
summary: Remove Address
|
242
257
|
patch:
|
243
258
|
description: >-
|
244
259
|
Update selected Address for the signed in User
|
@@ -247,13 +262,7 @@ paths:
|
|
247
262
|
- Account
|
248
263
|
operationId: 'Update Address'
|
249
264
|
parameters:
|
250
|
-
-
|
251
|
-
in: path
|
252
|
-
required: true
|
253
|
-
description: Selected Address for update
|
254
|
-
schema:
|
255
|
-
type: string
|
256
|
-
example: '1'
|
265
|
+
- $ref: '#/components/parameters/AddressId'
|
257
266
|
requestBody:
|
258
267
|
required: true
|
259
268
|
content:
|
@@ -5246,6 +5255,14 @@ components:
|
|
5246
5255
|
- state_name
|
5247
5256
|
- country_iso
|
5248
5257
|
parameters:
|
5258
|
+
AddressId:
|
5259
|
+
name: address_id
|
5260
|
+
in: path
|
5261
|
+
required: true
|
5262
|
+
description: Address ID
|
5263
|
+
schema:
|
5264
|
+
type: string
|
5265
|
+
example: '1'
|
5249
5266
|
CreditCardIncludeParam:
|
5250
5267
|
name: include
|
5251
5268
|
in: query
|
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.2.
|
4
|
+
version: 4.2.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: 2021-
|
11
|
+
date: 2021-04-26 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.2.
|
33
|
+
version: 4.2.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.2.
|
40
|
+
version: 4.2.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rabl
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -310,9 +310,9 @@ licenses:
|
|
310
310
|
- BSD-3-Clause
|
311
311
|
metadata:
|
312
312
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
313
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.
|
313
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.2
|
314
314
|
documentation_uri: https://guides.spreecommerce.org/
|
315
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.2.
|
315
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.2.2
|
316
316
|
post_install_message:
|
317
317
|
rdoc_options: []
|
318
318
|
require_paths:
|
@@ -328,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
328
328
|
- !ruby/object:Gem::Version
|
329
329
|
version: '0'
|
330
330
|
requirements: []
|
331
|
-
rubygems_version: 3.
|
331
|
+
rubygems_version: 3.1.4
|
332
332
|
signing_key:
|
333
333
|
specification_version: 4
|
334
334
|
summary: Spree's API
|