solidus_api 2.11.1 → 2.11.6

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: 677184871b6d918a39cd9350c60dadf152a9a2c445a752da8c13c6224a0506f6
4
- data.tar.gz: '029805e52c37f1220a71ebdab7cded4443605823ef38685e5129aa40d5833cdd'
3
+ metadata.gz: 04b62a4de33a633fba3d833805d5ebfa91b9f28d46763f9fd1bc8c07789f349f
4
+ data.tar.gz: 0fb5e28bc73ffbe257510b4d2d865254fdfa0b6a851e0ace9ca1b229101fdb26
5
5
  SHA512:
6
- metadata.gz: 3b76da3812798048cbb8a72819a939a900cf70af5de0fc4b8bac4ab54021464db79d6d4d94884a6b5814114dcf03e6e327dd01f5f8e955b6c78e0171304cdea4
7
- data.tar.gz: f81fc6ed60f35d5c8bf7599a559d028179c60259865ed55fed68feef462dd269fd79f555a1e5de4947d53d78cbe8519bca89c4d652125081cecf256bb0dab050
6
+ metadata.gz: d8bc4c45373aaa458e01bd80bdb830bf33fed50b9ce65d04ef4df514160fbf59b4b91f9efc2de963e4e38c8ea25042e42b37a736c85e6b6e2c69eb5436e3368c
7
+ data.tar.gz: 16cdb3e1bc6dd4d2c72fdcfc6a4cb349e9de88f15e72d5325d8096117a4a95c22d11a718740f5b1d354a09595cf65f0783e8b6e034372c302f47c3f2a1f92a30
@@ -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: exception.message,
81
- error: exception.message,
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.destroy
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: "spree@example.com", spree_roles: [])
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.1
4
+ version: 2.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-06 00:00:00.000000000 Z
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.1
61
+ version: 2.11.6
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.1
68
+ version: 2.11.6
69
69
  description: REST API for the Solidus e-commerce framework.
70
70
  email: contact@solidus.io
71
71
  executables: []