wacrm/src
Arnas Donauskas cd04e0682c
fix(broadcasts): attach user_id on send, surface errors with toast
The INSERT into broadcasts in use-broadcast-sending.ts never set
user_id, but broadcasts.user_id is NOT NULL + RLS-guarded. The
INSERT rejected (23502 / 42501), the hook threw, handleSend caught
with console.error only. UI showed nothing — the wizard stayed on
Step 4 and the flow appeared dead.

Fix:
- Resolve session.user at the top of createAndSendBroadcast and
  include user_id on the broadcasts INSERT.
- handleSend in /broadcasts/new now toasts the error via sonner so
  future failures are visible immediately instead of vanishing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:55:18 +03:00
..
app fix(broadcasts): attach user_id on send, surface errors with toast 2026-04-17 13:55:18 +03:00
components feat(broadcasts) C: custom-field audience, exclude tags, live preview 2026-04-17 11:39:24 +03:00
hooks fix(broadcasts): attach user_id on send, surface errors with toast 2026-04-17 13:55:18 +03:00
lib fix(broadcasts): per-recipient variables, webhook status sync, rate limit 2026-04-17 11:22:38 +03:00
types fix(broadcasts): per-recipient variables, webhook status sync, rate limit 2026-04-17 11:22:38 +03:00
middleware.ts Initial scaffold: WhatsApp CRM with Next.js + Supabase 2026-04-16 18:17:31 +03:00