Class: Launchpad::API::V2::Private::IEO::SalesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- Launchpad::ApplicationController
- BaseController
- Launchpad::API::V2::Private::IEO::SalesController
- Defined in:
- app/controllers/launchpad/api/v2/private/ieo/sales_controller.rb
Instance Method Summary collapse
Methods included from JWTPayload
#email, #jwt_payload, #role, #uid
Methods included from ExceptionHandlers
Methods included from Response
#controller_namespace, #error_response, #errors_response, #json_response, #not_found
Instance Method Details
#show ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/controllers/launchpad/api/v2/private/ieo/sales_controller.rb', line 9 def show launchpad = Launchpad::IEO::Sale.find(params[:id]) additional_params = { generic_bids: launchpad.orders.where("state = ? OR state = ? OR state = ?", 'active', 'completed', 'purchased').last(50).as_json(uid: true), my_bids: launchpad.orders.where(uid: uid).as_json(uid: true).last(50), } json_response(launchpad.as_json.merge(additional_params), 200) end |