Private
Public Access
1
0

Wire up webhook dispatch for all board/column/card events

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-03-08 10:41:47 -04:00
parent e8c70bde87
commit a57f83c5cd
5 changed files with 17 additions and 0 deletions
@@ -5,6 +5,7 @@ import { withTenant } from '$lib/server/rls.js';
import { requireBoardView, requireBoardEditor, requireBoardOwner } from '$lib/server/guards.js';
import { broadcast } from '$lib/server/realtime.js';
import { logActivity } from '$lib/server/activity.js';
import { dispatchWebhooks } from '$lib/server/webhooks.js';
// Get single board with all columns and cards
export const GET: RequestHandler = async ({ params, locals }) => {
@@ -50,6 +51,7 @@ export const PATCH: RequestHandler = async ({ params, request, locals }) => {
const socketId = request.headers.get('X-Socket-ID');
broadcast(params.boardId, 'board:updated', { board: updated, socketId });
broadcast(params.boardId, 'activity:new', { boardId: params.boardId, socketId });
dispatchWebhooks(tenant.id, 'board:updated', { boardId: params.boardId, board: updated });
return json({ board: updated });
};