Improve GDPR implementation
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user