Billing Stripe, link regia mobile e staff solo trasmissione.
Aggiunge fatturazione club, pagina regia condivisibile senza account, roster squadre e rimuove la modalità controller dall'app (v1.1.0). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,8 @@ module Api
|
||||
before_action :set_session, except: :create
|
||||
|
||||
def create
|
||||
match = Match.joins(:team).merge(current_user.manageable_teams).find(params[:match_id])
|
||||
team_ids = current_user.streamable_teams.map(&:id)
|
||||
match = Match.where(team_id: team_ids).find(params[:match_id])
|
||||
session = Sessions::Create.new(user: current_user, match: match, params: session_params).call
|
||||
render json: session_json(session), status: :created
|
||||
end
|
||||
@@ -66,6 +67,15 @@ module Api
|
||||
}
|
||||
end
|
||||
|
||||
def regia_link
|
||||
access = Sessions::RegiaAccess.new(@session)
|
||||
token = access.issue_token!
|
||||
render json: {
|
||||
regia_url: access.url(token),
|
||||
expires_at: @session.regia_token_expires_at
|
||||
}
|
||||
end
|
||||
|
||||
def claim_pairing
|
||||
token = params.require(:pairing_token)
|
||||
digest = Digest::SHA256.hexdigest(token)
|
||||
@@ -101,8 +111,9 @@ module Api
|
||||
private
|
||||
|
||||
def set_session
|
||||
@session = StreamSession.joins(match: :team)
|
||||
.merge(current_user.manageable_teams)
|
||||
team_ids = current_user.streamable_teams.map(&:id)
|
||||
@session = StreamSession.joins(:match)
|
||||
.where(matches: { team_id: team_ids })
|
||||
.find(params[:id])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user