test
This commit is contained in:
@@ -10,7 +10,7 @@ export class TestController {
|
||||
|
||||
@Post()
|
||||
@SwaggerBuscarFuncionario()
|
||||
findOne(@Body() ususario: { Nombre: string, Apellidos: string, IdUnidadResponsable: number }) {
|
||||
findOne(@Body() ususario: { Nombre: string, Apellidos: string, IdUnidadResponsable: number, nombreFlag: boolean }) {
|
||||
return this.testService.buscarFuncionario(ususario);
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -23,25 +23,25 @@ export class TestService {
|
||||
return `This action returns a #${id} test`;
|
||||
}
|
||||
|
||||
async buscarFuncionario(entrada: DatosEntradaDirectorio) {
|
||||
const url = process.env.NEXT_PUBLIC_API_WEB1;
|
||||
|
||||
|
||||
|
||||
|
||||
async buscarFuncionario(entrada: DatosEntradaDirectorio, nombreFlag: boolean = true) {
|
||||
|
||||
let url;
|
||||
|
||||
if (nombreFlag) {
|
||||
url = process.env.NEXT_PUBLIC_API_WEB1;
|
||||
} else {
|
||||
url = process.env.NEXT_PUBLIC_API_WEB2;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
|
||||
|
||||
interface DatosRespuestaDirectorio {
|
||||
IdUnidadResponsable: number;
|
||||
UnidadResponsable: string;
|
||||
Cargo: string;
|
||||
Titulo: string;
|
||||
Nombre: string;
|
||||
Apellidos: string;
|
||||
Telefono: string;
|
||||
Correo: string;
|
||||
Nivel: number;
|
||||
IdUnidadResponsablePapa: number;
|
||||
UnidadResponsablePapa: string;
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
throw new Error('La URL del servicio no está definida en las variables de entorno.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user