Fix QR code generation, new scanner styling and ability to choose events.

This commit is contained in:
Roman Krček
2025-07-08 16:35:27 +02:00
parent 6f563bbf7e
commit af22543ec8
6 changed files with 191 additions and 52 deletions

View File

@@ -16,15 +16,8 @@ interface EmailResult {
error?: string;
}
async function generateQRCode(participant: Participant, eventId: string): Promise<string> {
const qrCodeData = JSON.stringify({
participantId: participant.id,
eventId: eventId,
name: participant.name,
surname: participant.surname
});
const qrCodeBase64 = await QRCode.toDataURL(qrCodeData, {
async function generateQRCode(participantId: string): Promise<string> {
const qrCodeBase64 = await QRCode.toDataURL(participantId, {
type: 'image/png',
margin: 2,
scale: 8
@@ -43,7 +36,7 @@ async function sendEmailToParticipant(
supabase: any
): Promise<EmailResult> {
try {
const qrCodeBase64Data = await generateQRCode(participant, eventId);
const qrCodeBase64Data = await generateQRCode(participant.id);
// Send email with QR code
await sendGmail(refreshToken, {