We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39ad326 commit e2f282aCopy full SHA for e2f282a
1 file changed
app/modules/ai_intelligence/controllers/draft_controller.rb
@@ -9,10 +9,12 @@ class DraftController < Api::V1::BaseController
9
10
# POST /api/v1/ai/draft/analyze
11
def analyze
12
- team_a = params.require(:team_a)
13
- team_b = params.require(:team_b)
+ team_a = Array(params[:team_a]).reject(&:blank?)
+ team_b = Array(params[:team_b]).reject(&:blank?)
14
patch = params[:patch]
15
16
+ return render json: { error: 'team_a or team_b required' }, status: :bad_request if team_a.empty? && team_b.empty?
17
+
18
result = DraftAnalyzer.call(team_a: team_a, team_b: team_b, patch: patch)
19
20
if result.source == 'ml_v2'
0 commit comments