- Add slug/short_id fields to database with auto-generation

- Create migration script for existing data
- Update admin interface to show only short URLs
- Implement redirect system to avoid code duplication
- Maintain backward compatibility with old URLs
This commit is contained in:
Yannick Le Duc
2025-08-26 22:28:11 +02:00
parent bd4f63b99c
commit caf0478e02
12 changed files with 1040 additions and 110 deletions

View File

@@ -29,8 +29,10 @@ export default function SendParticipantEmailModal({
const [sending, setSending] = useState(false);
const [result, setResult] = useState<{ success: boolean; message: string } | null>(null);
// Générer le lien de vote
const voteUrl = `${typeof window !== 'undefined' ? window.location.origin : ''}/campaigns/${campaign.id}/vote/${participant.id}`;
// Générer le lien de vote (utiliser uniquement le lien court)
const voteUrl = participant.short_id
? `${typeof window !== 'undefined' ? window.location.origin : ''}/v/${participant.short_id}`
: `${typeof window !== 'undefined' ? window.location.origin : ''}/v/EN_ATTENTE`;
// Initialiser le message par défaut quand le modal s'ouvre
useEffect(() => {