diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 6fdd71d..1c821a0 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -18,6 +18,7 @@
@@ -103,6 +104,10 @@
+
+
+
+
+
diff --git a/node-api/src/routes/api.js b/node-api/src/routes/api.js
index 759efee..6d9c95d 100644
--- a/node-api/src/routes/api.js
+++ b/node-api/src/routes/api.js
@@ -126,4 +126,29 @@ router.get('/db/table/:name', async (req, res) => {
}
});
+// VLANs
+router.post('/vlans', async (req, res) => {
+ try {
+ const { id, nombre, descripcion } = req.body || {};
+ const vid = Number(id);
+ if (!Number.isInteger(vid) || vid <= 0) {
+ return res.status(400).json({ ok: false, error: 'invalid_vlan_id' });
+ }
+ if (!nombre || String(nombre).trim() === '') {
+ return res.status(400).json({ ok: false, error: 'nombre_required' });
+ }
+ await pool.query(
+ 'INSERT INTO vlans (id, nombre, descripcion) VALUES ($1, $2, $3)',
+ [vid, String(nombre), descripcion != null ? String(descripcion) : null]
+ );
+ res.json({ ok: true });
+ } catch (e) {
+ if (e && e.code === '23505') {
+ return res.status(409).json({ ok: false, error: 'vlan_exists' });
+ }
+ console.error('POST /api/vlans error:', e?.message || e);
+ res.status(500).json({ ok: false, error: 'db_error' });
+ }
+});
+
export default router;