Class: Dscf::Marketplace::SupplierProductsController

Inherits:
ApplicationController show all
Includes:
Core::Common
Defined in:
app/controllers/dscf/marketplace/supplier_products_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#bypass_permissions_for_demo?, #pundit_user

Instance Method Details

#my_productsObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/dscf/marketplace/supplier_products_controller.rb', line 6

def my_products
  authorize @clazz.new, :my_products?
  service = MyResourceService.new(current_user)
  products = service.my_products(params)

  options = {
    include: default_serializer_includes[:index] || [],
    meta: {resource_type: "my_products"}
  }

  render_success("supplier_products.success.index", data: products, serializer_options: options)
end