fix(comm): handle null team field in lead creation
BOC CI/CD / Test (push) Failing after 1s
BOC CI/CD / Security Scan (push) Has been skipped
BOC CI/CD / Build & Push (push) Has been skipped
BOC CI/CD / Deploy to Staging (push) Has been skipped
BOC CI/CD / Deploy to Production (push) Has been skipped

This commit is contained in:
Bernt
2026-08-12 11:00:00 +00:00
parent 417903b488
commit 447ce6f713
3 changed files with 3 additions and 3 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -95,12 +95,12 @@ func (h *LeadHandler) CreateLead(w http.ResponseWriter, r *http.Request) {
interest, product, urgency, customer_type, tags, status)
VALUES ($1, $2, $3, $4, $5, $6, $7, COALESCE($8, 'normal'), $9, $10, 'new')
RETURNING id, tenant_id, contact_id, conversation_id, source, status, interest, product,
urgency, customer_type, owner, team, lead_score, qualification_complete,
urgency, customer_type, owner, lead_score, qualification_complete,
last_interaction_at, next_action_at, next_action_type, tags, created_at, updated_at
`, tenantID, req.ContactID, nullUUID(req.ConversationID), req.Source, sourceMetadata,
req.Interest, req.Product, req.Urgency, req.CustomerType, req.Tags).Scan(
req.Interest, req.Product, req.Urgency, req.CustomerType, nullStringArray(req.Tags)).Scan(
&lead.ID, &lead.TenantID, &lead.ContactID, &lead.ConversationID, &lead.Source, &lead.Status,
&lead.Interest, &lead.Product, &lead.Urgency, &lead.CustomerType, &lead.Owner, &lead.Team,
&lead.Interest, &lead.Product, &lead.Urgency, &lead.CustomerType, &lead.Owner,
&lead.LeadScore, &lead.QualificationComplete, &lead.LastInteractionAt, &lead.NextActionAt,
&lead.NextActionType, &lead.Tags, &lead.CreatedAt, &lead.UpdatedAt,
)