Class: Launchpad::API::V2::Private::IEO::SalesController

Inherits:
BaseController show all
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

included

Methods included from Response

#controller_namespace, #error_response, #errors_response, #json_response, #not_found

Instance Method Details

#showObject



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