Modificaciones del carrusel

This commit is contained in:
Patriots01
2026-08-03 11:14:41 -06:00
parent f02dd40d51
commit 028a8b277d
6 changed files with 80 additions and 4 deletions
+40
View File
@@ -0,0 +1,40 @@
import { Body, Controller, InternalServerErrorException, Post } from '@nestjs/common';
@Controller('tyl')
export class TylController {
@Post('')
async enviarTyl(@Body() body: { email: string }) {
try {
const user = 'acatlan'
const api = 'LW2rtatYP8o2PhCkIqeJV94d6a60cSvTmJXPbRpP';
const params = new URLSearchParams();
params.append('user_name', user!);
params.append('email', body.email);
params.append('api_key', process.env.API_KEY!);
const response = await fetch(
'https://accede.estudio.app/ventas-acatlan',
{
method: 'POST',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
body: params,
redirect: 'manual',
}
);
console.log('respuesta', response);
const redirectUrl = response.headers.get('location');
console.log('redirect', redirectUrl)
return { redirectUrl };
} catch (error) {
throw new InternalServerErrorException('Error al conectar con API externa');
}
}
}