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

@@ -93,9 +93,15 @@ interface Webhook {
instanceId?: string
}
interface Instance {
id: string
name: string
}
interface Props {
open: boolean
webhook?: Webhook | null
instances?: Instance[]
}
const props = defineProps<Props>()
@@ -129,8 +135,11 @@ const availableEvents = [
{ value: 'instance.qr', label: 'QR disponible' }
]
// TODO: Cargar instancias reales
const instanceOptions = ref<any[]>([])
// Instance options for selector
const instanceOptions = computed(() => [
{ label: 'Todas las instancias', value: null },
...(props.instances || []).map(i => ({ label: i.name, value: i.id }))
])
const isValid = computed(() => {
return form.value.name.trim() && form.value.url.trim() && form.value.events.length > 0