From 1761dcdfe8064694cffd4e5e18dcf52a681b627b Mon Sep 17 00:00:00 2001 From: Esteban Date: Thu, 12 Feb 2026 15:26:30 -0600 Subject: [PATCH] fix: tRPC router type adjustments (celulares, red) --- src/server/trpc/routers/celulares.router.ts | 3 ++- src/server/trpc/routers/red.router.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/trpc/routers/celulares.router.ts b/src/server/trpc/routers/celulares.router.ts index 6ca1ccd..3ecbc34 100644 --- a/src/server/trpc/routers/celulares.router.ts +++ b/src/server/trpc/routers/celulares.router.ts @@ -1,5 +1,6 @@ import { z } from 'zod' import { TRPCError } from '@trpc/server' +import { TipoDispositivo } from '@prisma/client' import { router, protectedProcedure, adminProcedure } from '../trpc' import { HeadwindClient } from '@/server/services/headwind/client' @@ -19,7 +20,7 @@ export const celularesRouter = router({ const { clienteId, estado, search, page = 1, limit = 20 } = input || {} const where = { - tipo: { in: ['CELULAR', 'TABLET'] as const }, + tipo: { in: ['CELULAR', 'TABLET'] as TipoDispositivo[] }, ...(ctx.user.clienteId ? { clienteId: ctx.user.clienteId } : {}), ...(clienteId ? { clienteId } : {}), ...(estado ? { estado } : {}), diff --git a/src/server/trpc/routers/red.router.ts b/src/server/trpc/routers/red.router.ts index 884edf2..04bab5f 100644 --- a/src/server/trpc/routers/red.router.ts +++ b/src/server/trpc/routers/red.router.ts @@ -1,5 +1,6 @@ import { z } from 'zod' import { TRPCError } from '@trpc/server' +import { TipoDispositivo } from '@prisma/client' import { router, protectedProcedure } from '../trpc' import { LibreNMSClient } from '@/server/services/librenms/client' @@ -19,7 +20,7 @@ export const redRouter = router({ .query(async ({ ctx, input }) => { const { clienteId, tipo, estado, search, page = 1, limit = 20 } = input || {} - const tiposRed = ['ROUTER', 'SWITCH', 'FIREWALL', 'AP', 'IMPRESORA', 'OTRO'] as const + const tiposRed: TipoDispositivo[] = ['ROUTER', 'SWITCH', 'FIREWALL', 'AP', 'IMPRESORA', 'OTRO'] const where = { tipo: tipo ? { equals: tipo } : { in: tiposRed }, @@ -289,7 +290,7 @@ export const redRouter = router({ const clienteId = ctx.user.clienteId || input.clienteId const where = { - tipo: { in: ['ROUTER', 'SWITCH', 'FIREWALL', 'AP', 'IMPRESORA', 'OTRO'] as const }, + tipo: { in: ['ROUTER', 'SWITCH', 'FIREWALL', 'AP', 'IMPRESORA', 'OTRO'] as TipoDispositivo[] }, ...(clienteId ? { clienteId } : {}), }