Fix: Checkboxes de eventos en formulario de webhook
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m2s

This commit is contained in:
2025-12-02 20:39:16 -06:00
parent 738584514d
commit ae8e4e37a7
6 changed files with 214 additions and 5 deletions

View File

@@ -0,0 +1,34 @@
/**
* GET /api/debug/blocklist
* Fetch the blocklist for an instance
*/
import { baileysManager } from '../../../services/baileys/manager'
export default defineEventHandler(async (event) => {
const username = getHeader(event, 'x-authentik-username')
if (!username) {
throw createError({ statusCode: 401, message: 'Unauthorized' })
}
const query = getQuery(event)
const instanceId = query.instanceId as string
if (!instanceId) {
throw createError({ statusCode: 400, message: 'instanceId is required' })
}
const socket = baileysManager.getSocket(instanceId)
if (!socket) {
throw createError({ statusCode: 400, message: 'Instance not connected' })
}
try {
const result = await socket.fetchBlocklist()
return { success: true, data: result }
} catch (error) {
throw createError({
statusCode: 500,
message: `Failed to fetch blocklist: ${(error as Error).message}`
})
}
})