solidus_api 2.11.3 → 2.11.8
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: 36ccb742d4991fa7ed5ffbcc598510725750dae2cafe0a6424412e78c0ea48ae
|
4
|
+
data.tar.gz: a3a0ded46cdb094ff24508b7eab0351f8522438d22fe7dcd49af81fc0436d43d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 225b7cde460d4b3eac4631a2f572bdc0ea9ee6dc68e93ea7e1457e0b6ca6ef48d8686c6589ef99054f36c0a392145711330ef5aea7c21823013a4ffe04882c78
|
7
|
+
data.tar.gz: ab7a2ec530fe5479b54e96254763eabab55fd891faae2445d4399d0711eeec1fc7a80b0ef5874aec26cddcf09aee379ba736d4d4090dc4623f8ba1b22f0d3bac
|
@@ -76,9 +76,11 @@ module Spree
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def parameter_missing_error(exception)
|
79
|
+
# use original_message to remove DidYouMean suggestions, if defined
|
80
|
+
message = exception.try(:original_message) || exception.message
|
79
81
|
render json: {
|
80
|
-
exception:
|
81
|
-
error:
|
82
|
+
exception: message,
|
83
|
+
error: message,
|
82
84
|
missing_param: exception.param
|
83
85
|
}, status: :unprocessable_entity
|
84
86
|
end
|
@@ -53,7 +53,13 @@ class Spree::Api::ResourceController < Spree::Api::BaseController
|
|
53
53
|
def destroy
|
54
54
|
authorize! :destroy, @object
|
55
55
|
|
56
|
-
if @object.
|
56
|
+
destroy_result = if @object.respond_to?(:discard)
|
57
|
+
@object.discard
|
58
|
+
else
|
59
|
+
@object.destroy
|
60
|
+
end
|
61
|
+
|
62
|
+
if destroy_result
|
57
63
|
respond_with(@object, status: 204)
|
58
64
|
else
|
59
65
|
invalid_resource!(@object)
|
@@ -30,7 +30,7 @@ module Spree
|
|
30
30
|
# This method can be overriden (with a let block) inside a context
|
31
31
|
# For instance, if you wanted to have an admin user instead.
|
32
32
|
def current_api_user
|
33
|
-
@current_api_user ||= stub_model(Spree::LegacyUser, email: "
|
33
|
+
@current_api_user ||= stub_model(Spree::LegacyUser, email: "solidus@example.com", spree_roles: [])
|
34
34
|
end
|
35
35
|
|
36
36
|
def image(filename)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jbuilder
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.11.
|
61
|
+
version: 2.11.8
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.11.
|
68
|
+
version: 2.11.8
|
69
69
|
description: REST API for the Solidus e-commerce framework.
|
70
70
|
email: contact@solidus.io
|
71
71
|
executables: []
|