solidus_api 2.11.3 → 2.11.4
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: 75de9120186ffc6697dacf05b5df0ca7b531edffbb6c7c765e268ca3af3b4a35
|
4
|
+
data.tar.gz: b658c71252435588cf5b5d05fa168238e24088f20e40f6fec15f2acaf70f6cc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7712941de737d98173d1b636e05b4085049bbaf66ed5440cdfc60f95ca411a4ca1abf66802772c76d7313704898865b05154b226d959af88332878009aed6cae
|
7
|
+
data.tar.gz: e4786bca23b4766c3af2a4872b74d0602f601fc0371ec97901297636d0916a90f9d03e22a850238f9179b2ee5ba0f4302dcefbfe0402f93abeb07dfc93c89447
|
@@ -76,9 +76,10 @@ module Spree
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def parameter_missing_error(exception)
|
79
|
+
message = exception.original_message || exception.message
|
79
80
|
render json: {
|
80
|
-
exception:
|
81
|
-
error:
|
81
|
+
exception: message,
|
82
|
+
error: message,
|
82
83
|
missing_param: exception.param
|
83
84
|
}, status: :unprocessable_entity
|
84
85
|
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.4
|
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-01-19 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.4
|
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.4
|
69
69
|
description: REST API for the Solidus e-commerce framework.
|
70
70
|
email: contact@solidus.io
|
71
71
|
executables: []
|