Webhooks: Completar integracion backend-frontend
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m1s

- Inicializar webhookDispatcher en plugin de servidor
- Conectar pagina de webhooks con API
- Agregar selector de instancias en formulario
- Corregir bug en toast de handleSaved
This commit is contained in:
2025-12-02 20:33:48 -06:00
parent a750bd9163
commit 738584514d
3 changed files with 151 additions and 22 deletions

View File

@@ -1,7 +1,8 @@
/**
* Nitro plugin to initialize Baileys manager on server start
* Nitro plugin to initialize Baileys manager and Webhook dispatcher on server start
*/
import { baileysManager } from '../services/baileys/manager'
import { webhookDispatcher } from '../services/webhooks/dispatcher'
export default defineNitroPlugin(async () => {
console.log('[Plugin] Initializing Baileys Manager...')
@@ -12,7 +13,11 @@ export default defineNitroPlugin(async () => {
try {
await baileysManager.initialize()
console.log('[Plugin] Baileys Manager initialized successfully')
// Initialize webhook dispatcher after baileys manager
await webhookDispatcher.initialize()
console.log('[Plugin] Webhook Dispatcher initialized successfully')
} catch (error) {
console.error('[Plugin] Failed to initialize Baileys Manager:', error)
console.error('[Plugin] Failed to initialize:', error)
}
})