solidus_api 2.11.2 → 2.11.7
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: a9cc4e165bc73fd44ac8a0ec456972dff0804e86fe334240d93f5a8043a2180f
|
4
|
+
data.tar.gz: 6638b7fa31b9879204f241c802f5868318e28a89b84ece3d9e7cdc6bf5981c21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb519f2d8cc92ef81073c7e01d355b9bb6ade8546e1bee7f6f2a47b240bc63226ee673b453ba21b1f2e9617252d9d7db33dd35cf0cd923a2f5330f58eb476cd1
|
7
|
+
data.tar.gz: 628c7e1cdfa032ef4cbc9313d13467ae5756375a32e7b10537fda521c35fa2718043eb7951fe056bae6b424a3b6ccbd00c5437f72bfd2d45ae19ad0ebfc36707
|
@@ -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,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.7
|
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-18 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.7
|
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.7
|
69
69
|
description: REST API for the Solidus e-commerce framework.
|
70
70
|
email: contact@solidus.io
|
71
71
|
executables: []
|