refactor(webhook): remove singleton webhook logic

This commit is contained in:
Ali BARIN
2025-01-13 16:11:29 +00:00
parent d688a97081
commit e4b31c7f52
5 changed files with 1 additions and 71 deletions

View File

@@ -4,7 +4,6 @@ import multer from 'multer';
import appConfig from '../config/app.js';
import webhookHandlerByFlowId from '../controllers/webhooks/handler-by-flow-id.js';
import webhookHandlerSyncByFlowId from '../controllers/webhooks/handler-sync-by-flow-id.js';
import webhookHandlerByConnectionIdAndRefValue from '../controllers/webhooks/handler-by-connection-id-and-ref-value.js';
const router = Router();
const upload = multer();
@@ -39,14 +38,6 @@ function createRouteHandler(path, handler) {
.post(wrappedHandler);
}
createRouteHandler(
'/connections/:connectionId/:refValue',
webhookHandlerByConnectionIdAndRefValue
);
createRouteHandler(
'/connections/:connectionId',
webhookHandlerByConnectionIdAndRefValue
);
createRouteHandler('/flows/:flowId/sync', webhookHandlerSyncByFlowId);
createRouteHandler('/flows/:flowId', webhookHandlerByFlowId);
createRouteHandler('/:flowId', webhookHandlerByFlowId);