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:
@@ -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 });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user