You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
660 B
24 lines
660 B
class BiddingUsersController < ApplicationController
|
|
before_action :require_login, :check_auth
|
|
|
|
def create
|
|
ProjectPackages::BiddingService.call(current_package, current_user)
|
|
render_ok
|
|
rescue ProjectPackages::BiddingService::Error => ex
|
|
render_error(ex.message)
|
|
end
|
|
|
|
def win
|
|
package = current_user.project_packages.find(params[:project_package_id])
|
|
ProjectPackages::WinBiddingService.call(package, params)
|
|
render_ok
|
|
rescue ProjectPackages::WinBiddingService::Error => ex
|
|
render_error(ex.message)
|
|
end
|
|
|
|
private
|
|
|
|
def current_package
|
|
@_current_package ||= ProjectPackage.find(params[:project_package_id])
|
|
end
|
|
end |