solidus_api 2.11.0 → 2.11.5
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: b700b541040c01e87ec18bc5d65f51be73904fc72eed6cb11702f3d59e29857f
|
4
|
+
data.tar.gz: 1e218892060c961813eff6df57d8183f51704fdfd98670c6adef7805e546a42d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34dfc56c007035a10026061a90ddc88eb561829291bc4f1c195a40a65e494d70723b3c98d674ccdbca71faceaf9d88f376a45413814f7d8351b929834e4da883
|
7
|
+
data.tar.gz: 316013b0da91d2393f9528bbcb77125eda9de788238f7efc6f94f072adcf7aa721711d983fb86f7b2d35931cb510d895e790a523e67fe7ea659a03cb20f78c04
|
@@ -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
|
@@ -20,7 +20,7 @@ module Spree
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def update
|
23
|
-
@image = scope.images.accessible_by(current_ability, :update).find(params[:id])
|
23
|
+
@image = scope.gallery.images.accessible_by(current_ability, :update).find(params[:id])
|
24
24
|
@image.update(image_params)
|
25
25
|
respond_with(@image, default_template: :show)
|
26
26
|
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,11 +30,20 @@ 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)
|
37
|
-
File.open(
|
37
|
+
File.open(
|
38
|
+
File.join(
|
39
|
+
Spree::Core::Engine.root,
|
40
|
+
"lib",
|
41
|
+
"spree",
|
42
|
+
"testing_support",
|
43
|
+
"fixtures",
|
44
|
+
filename
|
45
|
+
)
|
46
|
+
)
|
38
47
|
end
|
39
48
|
|
40
49
|
def upload_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.5
|
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-03-10 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.5
|
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.5
|
69
69
|
description: REST API for the Solidus e-commerce framework.
|
70
70
|
email: contact@solidus.io
|
71
71
|
executables: []
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
- !ruby/object:Gem::Version
|
273
273
|
version: 1.8.23
|
274
274
|
requirements: []
|
275
|
-
rubygems_version: 3.
|
275
|
+
rubygems_version: 3.1.4
|
276
276
|
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: REST API for the Solidus e-commerce framework.
|