Ultimas revisiones

This commit is contained in:
SinR0str0
2026-08-08 23:00:46 -06:00
parent 5077af6727
commit 921d9a8970
74 changed files with 2095 additions and 1754 deletions
+31 -26
View File
@@ -1,40 +1,45 @@
import { Body, Controller, InternalServerErrorException, Post } from '@nestjs/common';
import {
Body,
Controller,
InternalServerErrorException,
Post,
} from '@nestjs/common';
@Controller('tyl')
export class TylController {
@Post('')
async enviarTyl(@Body() body: { email: string }) {
@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 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(
const response = await fetch(
'https://accede.estudio.app/ventas-acatlan',
{
method: 'POST',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
body: params,
redirect: 'manual',
}
);
method: 'POST',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
body: params,
redirect: 'manual',
},
);
console.log('respuesta', response);
console.log('respuesta', response);
const redirectUrl = response.headers.get('location');
const redirectUrl = response.headers.get('location');
console.log('redirect', redirectUrl)
return { redirectUrl };
console.log('redirect', redirectUrl);
return { redirectUrl };
} catch (error) {
throw new InternalServerErrorException('Error al conectar con API externa');
throw new InternalServerErrorException(
'Error al conectar con API externa',
);
}
}
}
}