diff --git a/client/src/pages/Generate.tsx b/client/src/pages/Generate.tsx index 82c8d46..1b634b0 100644 --- a/client/src/pages/Generate.tsx +++ b/client/src/pages/Generate.tsx @@ -118,7 +118,7 @@ export const Generate: React.FC = () => {
{ async (decodedText) => { try { scanner.clear(); - const data = JSON.parse(decodedText); + const ticketId = decodedText; const tickets = await getTickets('default-event'); // Hardcoded event - const ticket = tickets.find(t => t.id === data.id); + const ticket = tickets.find(t => t.id === ticketId); if (ticket) { if (ticket.status === 'valid') { diff --git a/src/tickets/tickets.service.ts b/src/tickets/tickets.service.ts index a6963e2..90ebd17 100644 --- a/src/tickets/tickets.service.ts +++ b/src/tickets/tickets.service.ts @@ -26,12 +26,8 @@ export class TicketsService { }); try { - // Generate QR code buffer with same format as frontend - const qrCodeData = JSON.stringify({ - id: ticket.id, - type: ticket.ticketType - }); - const qrCodeBuffer = await QRCode.toBuffer(qrCodeData, { + // Generate QR code buffer with ticket ID only + const qrCodeBuffer = await QRCode.toBuffer(ticket.id, { errorCorrectionLevel: 'H', // High error correction type: 'png', // Output as PNG image width: 250, // QR code width @@ -74,12 +70,8 @@ export class TicketsService { } try { - // Generate QR code buffer with same format as frontend - const qrCodeData = JSON.stringify({ - id: ticket.id, - type: ticket.ticketType - }); - const qrCodeBuffer = await QRCode.toBuffer(qrCodeData, { + // Generate QR code buffer with ticket ID only + const qrCodeBuffer = await QRCode.toBuffer(ticket.id, { errorCorrectionLevel: 'H', type: 'png', width: 250,