spree_api 3.1.4 → 3.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/config/routes.rb +6 -2
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1544f8129c19c9582f7cc2ffa8706c94e04a114
4
- data.tar.gz: 1fd594f0c18de4068aa143ecc8b9c02c7c4b6a81
3
+ metadata.gz: 4b8ad4edd7469cb2c67174d856ae8aa1284f183c
4
+ data.tar.gz: 2ab89546cef6d0e1a1ab7b89ae248030db2f4704
5
5
  SHA512:
6
- metadata.gz: 0f9bdbb7cc7160e38dddc84829be5c1d68dfaf259bf08069a98b44949bba8dbc0ff949472d066e95f7fe9a953d8e7f27af44a10304a98ee732f35c2d9369f83c
7
- data.tar.gz: 9db6d11821784259c834f9331de62693c7f0768a16d902d7b765a84da191cc18c9f3d3c3b01d2863e5024da54a4fb6370e6c29fb2295d58f41cfcc16cda6fe00
6
+ metadata.gz: f2a3c1859e39e8040005fe536d1d26e53e8dc6179a318435d74c26cf7ec7ccff9207e1bb26a3f30776175eac0414788158030d391d814da48d84cf8910be4811
7
+ data.tar.gz: dec9414e9c0f82be84fcd5a6c8a019ed10964c92e053610ee6a0df383bd44db14176adaf4bc7b094f05f83d6a22f76a17e2369f4440c20b2feb36b80a3deb985
data/config/routes.rb CHANGED
@@ -115,10 +115,14 @@ Spree::Core::Engine.add_routes do
115
115
  get '/taxons/products', to: 'taxons#products', as: :taxon_products
116
116
  end
117
117
 
118
- match 'v:api/*path', to: redirect("/api/v1/%{path}"), via: [:get, :post, :put, :patch, :delete]
118
+ spree_path = Rails.application.routes.url_helpers.try(:spree_path, trailing_slash: true) || '/'
119
+ match 'v:api/*path', to: redirect("#{spree_path}api/v1/%{path}"), via: [:get, :post, :put, :patch, :delete]
119
120
 
120
121
  match '*path', to: redirect{ |params, request|
121
- "/api/v1/#{params[:path]}?#{request.query_string}"
122
+ format = ".#{params[:format]}" unless params[:format].blank?
123
+ query = "?#{request.query_string}" unless request.query_string.blank?
124
+
125
+ "#{spree_path}api/v1/#{params[:path]}#{format}#{query}"
122
126
  }, via: [:get, :post, :put, :patch, :delete]
123
127
  end
124
128
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.4
19
+ version: 3.1.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.4
26
+ version: 3.1.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rabl
29
29
  requirement: !ruby/object:Gem::Requirement