wacrm/src/app/(dashboard)/broadcasts
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
..
[id] feat(broadcasts) B: list rates, detail funnel + CSV, save-as-draft 2026-04-17 11:31:13 +03:00
new fix(broadcasts): attach user_id on send, surface errors with toast 2026-04-17 13:55:18 +03:00
page.tsx feat(broadcasts) B: list rates, detail funnel + CSV, save-as-draft 2026-04-17 11:31:13 +03:00