fix(reportes): select con rol/activo para la lista de vendedores
This commit is contained in:
@@ -75,7 +75,7 @@ export async function reporteLeads(req: Request, res: Response): Promise<void> {
|
|||||||
where: { createdAt: rango, ...(vendedorId !== '' ? { usuarioId: vendedorId } : {}) },
|
where: { createdAt: rango, ...(vendedorId !== '' ? { usuarioId: vendedorId } : {}) },
|
||||||
orderBy: [{ usuarioId: 'asc' }, { createdAt: 'asc' }],
|
orderBy: [{ usuarioId: 'asc' }, { createdAt: 'asc' }],
|
||||||
})
|
})
|
||||||
const usuarios = await prisma.usuario.findMany({ select: { id: true, nombre: true } })
|
const usuarios = await prisma.usuario.findMany({ select: { id: true, nombre: true, rol: true, activo: true } })
|
||||||
const nombrePorId = new Map(usuarios.map((u) => [u.id, u.nombre]))
|
const nombrePorId = new Map(usuarios.map((u) => [u.id, u.nombre]))
|
||||||
res.json({
|
res.json({
|
||||||
vendedores: usuarios
|
vendedores: usuarios
|
||||||
|
|||||||
Reference in New Issue
Block a user