ishapi 0.1.8.281 → 0.1.8.282

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: 19db699cb43c11bc493a6c009574a43fa7a20ca64d87b6315c62c4824fe2907a
4
- data.tar.gz: 7dd89ba5e5a4aeeabb8e7c38331df6c9c90114117a4be08e80a57f33630df527
3
+ metadata.gz: cc630318a85a11adb850ff24945427f7f129ac4beb4f2ce9408663feab01174b
4
+ data.tar.gz: 654d3cb276509334ebeb2db252e65fddf0b6b8b820f342dbbbd6e1cfb03db987
5
5
  SHA512:
6
- metadata.gz: eb94d8840c83747781eb43d0e79f58162fffa6bc2f5aa5b8adddb615cf1f4b1ea16fe3d36f230eefcfe677abc243888b71370bf88f7d1e2ba6e8ab210e75f65b
7
- data.tar.gz: 5715fd3a1326280fe929f63f2fe9e517dd60e88c923ddf4d341337d9e7cca2b31ccf965ce410ea7bfe497d2405e54c0ed38c6f4e6087ab47974c56bce1bdc163
6
+ metadata.gz: c8c95e9e7e6ec52359c92d4c376d8e3198464e7ee40fdbe241040c33b6b7cc104d934d1680122de11806a40571e16b106e7770f6e75b7904d345b0f05cbdc94c
7
+ data.tar.gz: d74cfe728d233cecf852130536e7ce4f23b79d964a1faf84c69430e70e14a669e643f35cf108218a05829fea1ae91bbeec177708d55a3f89e4f15b4bd3cbdef5
@@ -0,0 +1,16 @@
1
+ require_dependency "ishapi/application_controller"
2
+
3
+ class Ishapi::ProductsController < Ishapi::ApplicationController
4
+
5
+ # before_action :soft_check_long_term_token, only: [ :show ]
6
+ before_action :check_jwt
7
+
8
+ def show
9
+ @product = Wco::Product.find params[:id]
10
+
11
+ puts! @product.prices.to_a, 'to_a'
12
+
13
+ authorize! :show, @product
14
+ end
15
+
16
+ end
@@ -4,6 +4,13 @@ class Ishapi::Ability
4
4
 
5
5
  def initialize user_profile
6
6
 
7
+ ##
8
+ ## super user
9
+ ##
10
+ if %w| piousbox@gmail.com |.include?( user_profile.email )
11
+ can [ :manage ], :all
12
+ end
13
+
7
14
  #
8
15
  # signed in user_profile
9
16
  #
@@ -1,9 +1,16 @@
1
1
 
2
2
  params.permit!
3
3
  json.cache! [ params, @product ] do
4
- json.cost @product.cost
5
- json.title @product.title
6
- json.description @product.description
7
- json.kind @product.kind
4
+
5
+ json.id @product.id.to_s
6
+ json.name @product.name
7
+
8
+ json.prices do
9
+ json.array! @product.prices do |price|
10
+ json.id price.id.to_s
11
+ json.name price.name
12
+ end
13
+ end
14
+
8
15
  end
9
16
 
data/config/routes.rb CHANGED
@@ -45,6 +45,16 @@ Ishapi::Engine.routes.draw do
45
45
  # N
46
46
  delete 'newsitems/:id', to: 'newsitems#destroy'
47
47
 
48
+ ## O
49
+
50
+ # resources :option_price_items
51
+ get 'option_price_items/view-by/symbol/:symbol', to: 'option_price_items#view_by_symbol', :constraints => { :symbol => /[^\/]+/ } ## the symbol is detailed eg 'GME_011924P30'
52
+ get 'option_price_items/index1', to: 'option_price_items#index', defaults: { kind: 'kind-1' }
53
+ get 'option_price_items/view/:symbol/from/:begin_at/to/:end_at', to: 'option_price_items#view'
54
+
55
+
56
+ ## P
57
+
48
58
  post 'do_purchase', to: 'gameui#do_purchase' # @TODO: rename to just purchase, or destroy endpoint
49
59
  post 'payments', :to => 'payments#create'
50
60
  post 'payments/unlock', to: 'payments#unlock' # do_purchase
@@ -53,13 +63,11 @@ Ishapi::Engine.routes.draw do
53
63
  get 'photos/view/:id', to: 'photos#show'
54
64
  get 'profiles/view/:username', :to => 'user_profiles#show'
55
65
 
56
- post 'stars/buy', to: 'gameui#buy_stars'
66
+ get 'products/:id', to: 'products#show'
57
67
 
68
+ ## S
58
69
 
59
- # resources :option_price_items
60
- get 'option_price_items/view-by/symbol/:symbol', to: 'option_price_items#view_by_symbol', :constraints => { :symbol => /[^\/]+/ } ## the symbol is detailed eg 'GME_011924P30'
61
- get 'option_price_items/index1', to: 'option_price_items#index', defaults: { kind: 'kind-1' }
62
- get 'option_price_items/view/:symbol/from/:begin_at/to/:end_at', to: 'option_price_items#view'
70
+ post 'stars/buy', to: 'gameui#buy_stars'
63
71
 
64
72
 
65
73
  get 'test', to: 'application#test'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.281
4
+ version: 0.1.8.282
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -228,6 +228,7 @@ files:
228
228
  - app/controllers/ishapi/orders_controller.rb
229
229
  - app/controllers/ishapi/payments_controller.rb
230
230
  - app/controllers/ishapi/photos_controller.rb
231
+ - app/controllers/ishapi/products_controller.rb
231
232
  - app/controllers/ishapi/stock_watches_controller.rb
232
233
  - app/controllers/ishapi/user_profiles_controller.rb
233
234
  - app/controllers/ishapi/users/registrations_controller.rb