feat: rediseño UI completo + infra email + stats
This commit is contained in:
parent
93d75ddafe
commit
24401c0ee5
37 changed files with 2162 additions and 412 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
const crypto = require('crypto');
|
||||
const { sendErasureMail, PROVIDER_DATA } = require('../services/mailer');
|
||||
const stats = require('../services/stats');
|
||||
|
||||
const ALLOWED_PROVIDERS = new Set(Object.keys(PROVIDER_DATA));
|
||||
|
||||
|
|
@ -50,6 +51,7 @@ module.exports = async (req, res) => {
|
|||
const result = await sendErasureMail({ provider, email, nickname, phone, address, extra });
|
||||
|
||||
if (result.skipped) {
|
||||
stats.record({ type: 'redirected', provider });
|
||||
return res.json({
|
||||
status: 'use_form',
|
||||
message: 'Este proveedor no acepta solicitudes por email. Usa su formulario oficial.',
|
||||
|
|
@ -58,7 +60,7 @@ module.exports = async (req, res) => {
|
|||
});
|
||||
}
|
||||
|
||||
// PII fuera de scope aquí — solo el hash queda
|
||||
stats.record({ type: 'sent', provider });
|
||||
res.json({
|
||||
status: 'ok',
|
||||
message: 'Solicitud enviada. Guarda el código de referencia.',
|
||||
|
|
@ -66,6 +68,7 @@ module.exports = async (req, res) => {
|
|||
});
|
||||
|
||||
} catch (e) {
|
||||
stats.record({ type: 'error' });
|
||||
console.error('erase route error:', e.message);
|
||||
res.status(500).json({ error: 'Error interno. Inténtalo de nuevo o usa el formulario oficial del proveedor.' });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue