Improve GDPR implementation

This commit is contained in:
Urtzi Alfaro
2025-10-16 07:28:04 +02:00
parent dbb48d8e2c
commit b6cb800758
37 changed files with 4876 additions and 307 deletions

View File

@@ -182,11 +182,21 @@ const SubscriptionPage: React.FC = () => {
try {
setCancelling(true);
// In a real implementation, this would call an API endpoint to cancel the subscription
// const result = await subscriptionService.cancelSubscription(tenantId);
// For now, we'll simulate the cancellation
addToast('Tu suscripción ha sido cancelada', { type: 'success' });
const result = await subscriptionService.cancelSubscription(tenantId, 'User requested cancellation');
if (result.success) {
const daysRemaining = result.days_remaining;
const effectiveDate = new Date(result.cancellation_effective_date).toLocaleDateString('es-ES', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
addToast(
`Suscripción cancelada. Acceso de solo lectura a partir del ${effectiveDate} (${daysRemaining} días restantes)`,
{ type: 'success' }
);
}
await loadSubscriptionData();
setCancellationDialogOpen(false);