comee_core 0.1.60 → 0.1.62

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: 592703997e22009366578acb6e8900315e51f461734f14ecf5c9b9920d9594a4
4
- data.tar.gz: 5d0eded1e193fee4c4cfcc7e4b3f84337c8655e3826ad8a694209627411f25de
3
+ metadata.gz: bddc614dddc4d9d2d3eeb9756abfb54e558223289ce15b3fc715bf30cbbd3a9c
4
+ data.tar.gz: beec0b6fac03ad5bf2ca4c53a1c9bc55af09eb71ec2a62a32e99043a951fdfba
5
5
  SHA512:
6
- metadata.gz: d14f1f7427da0475508ba027d47df2a231d20431377e386ffe611f56d3be8ad6caa3d8500492561738c15eef7fbaa2130242f4b99368b3340421240a9e877bcb
7
- data.tar.gz: 31aabe3e245b3378494e730b1bb965f331b63c458d1715d1abc238c12d5fbe8e0e77a7322c77a6cf4f3ddd96f9059a55294a0b278eb373e57ea288296c89f1b3
6
+ metadata.gz: c307992aa32dab21e9ad928051be6ee6a768f19f90d7f754510faff5f89ab83856f399eabe401c78089f15ab37e1035d778129340a363bb9521dea6d6176812d
7
+ data.tar.gz: 3218e7f848bb8970c25e0b6360c6a099e49d022425e76d07fdbbaffc5665027e202cfcc44b5464e9d7ca26211d3439fc49ee2c767166f2d86c735d3b3353594b
@@ -27,6 +27,11 @@ module Comee
27
27
  render json: {success: true, data: serialize(data)}
28
28
  end
29
29
 
30
+ def filter
31
+ products = Product.ransack(params[:q]).result
32
+ render json: {success: true, data: serialize(products)}
33
+ end
34
+
30
35
  private
31
36
 
32
37
  def model_params
@@ -71,7 +71,7 @@ module Comee
71
71
 
72
72
  def rfq_params
73
73
  params.require(:payload).permit(:client_id, :order_number, :order_date, :delivery_address, :invoice_address,
74
- items: %i[product_id unit_id quantity expected_delivery_date])
74
+ items: %i[product_id unit_id customer_item_no quantity expected_delivery_date])
75
75
  end
76
76
  end
77
77
  end
@@ -14,7 +14,12 @@ module Comee
14
14
  else
15
15
  @clazz.all
16
16
  end
17
- render json: {success: true, data: serialize(data)}
17
+ page = params[:page]
18
+ if page
19
+ render json: {success: true, data: serialize(data), page: page, total: @clazz.count}
20
+ else
21
+ render json: {success: true, data: serialize(data)}
22
+ end
18
23
  end
19
24
 
20
25
  def show
@@ -28,6 +28,10 @@ module Comee
28
28
  images.attached? ? images.map { |image| Rails.application.routes.url_helpers.rails_blob_url(image, only_path: false) } : []
29
29
  end
30
30
 
31
+ def self.ransackable_attributes(_auth_object = nil)
32
+ %w[code name description]
33
+ end
34
+
31
35
  def default_unit
32
36
  preferred_units.find { |unit| unit["default"] }
33
37
  end
data/config/routes.rb CHANGED
@@ -93,4 +93,5 @@ Comee::Core::Engine.routes.draw do
93
93
  resources :customs_details
94
94
  resources :item_statuses
95
95
  post "/item_statuses/filter", controller: :item_statuses, action: :filter
96
+ post "/products/filter", controller: :products, action: :filter
96
97
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.60".freeze
3
+ VERSION = "0.1.62".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.60
4
+ version: 0.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-19 00:00:00.000000000 Z
11
+ date: 2023-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers